On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • So, it’s only taken me a dozen or so site moves (from a staging server to the live URL) to figure this out, but here’s my tip:

    If you’ve ever developed a site at a staging URL, either the IP or a different domain, you’ve probably run into problems when you’ve moved it to the live URL. This is usually because the RTE makes your paths complete URLs, so instead of having the src of an image be /assets/images/pic1.jpg, it turns into http://stagingdomain/assets/images/pic1.jpg

    If you have more than a couple pages, it’s a pain to go back and manually change each broken image once the site is live.

    The fix? Turn off the "Image Rewrite Paths" in the manager, and change the "Resource URL" from "http://mydomain.com/assets" to just "/assets/" (no quotes, of course).

    Now all your resources should be made with the absolute path from the web root, which is a good strategy, in my experience. This approach would need to be modified to work on installations where MODx is not in the web root.

    If anybody has any other advice on how to do this, or reasons that the above approach is wrong, let me know, but it seems to work better than any other option for me, and I haven’t had any problems with it. Also, if anybody knows why the default Resource URL has the http://domain/ in it in the first place, I’d love to hear.

    -Brett
      Need MODx Ecommerce? Try FoxyCart!
    • Very cool tip, will save me a lot of time. Thanks.
      • Pretty much what I have been doing also, it works fine !

        The only problems I have had so far are character encoding (those french accents...), but that’s due to different setup between local and server MySQL version and/or settings...
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l'outil id
        • What I do is simple and works all the time. I move a complete modx-site in 10 minutes.

          copy modx to the new server (if posible use flashfxp for server2server transfer, server needs to suport fxp)

          make a backup of your database (add droptable)
          open the sql in notepad do a search and replace of the domain, import the database back and your done.

          do a refresh of the site ones your logged in to get all the cash refreshed

          Greets Dimmy


            follow me on twitter: @dimmy01
          • Yeah agreed it’s amazing but I did one transfert today took me no more than 10/15 minutes smiley

            MODx is great as far as reducing the cycle from test to production server smiley
              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l'outil id
            • @davidm : could you integrate these infos in your awaited tutorial? Thanks.
              • Most definitely will... but this week I have two websites going online, pretty busy...
                  .: COO - Commerce Guys - Community Driven Innovation :.


                  MODx est l'outil id
                • One thing that helps in moving websites is using the CSS as document technique smiley

                  I’ll really try to write the tuto soon, been overworked lately...
                    .: COO - Commerce Guys - Community Driven Innovation :.


                    MODx est l'outil id
                  • Quote from: bugsmi0 at Mar 23, 2006, 08:01 PM

                    One of the problems I’ve found when backing up a database and re-inserting into server database is there may exist in a stock installation some data ID or user ID when you insert the stuff it often ends up refused due to already existing ID.

                    Does this happen also with Modx ?

                    It won’t happen, if you ensure that your database clean from previous MODx installation or some other database application. If it’s empty, 99.99% it won’t happen. The last 0.01% is due to unknown reason that sometimes just happen, even though you’ve done everything correctly. wink
                      Wendy Novianto
                      [font=Verdana]PT DJAMOER Technology Media
                      [font=Verdana]Xituz Media
                    • Hi,

                      Quote from: Dimmy at Jan 23, 2006, 10:52 PM

                      copy modx to the new server
                      make a backup of your database (add droptable)
                      open the sql in notepad do a search and replace of the domain, import the database back and your done.

                      I’m planning to move my site on another host, so your tip seems to be very interesting. However, I guess the file config.inc.php must be also updated ... Is there some other files to update ?

                      Tristan