Topic: [TIP] Making Site moves from Staging to Production Easier  (Read 11151 times)

Pages: [1]   Go Down

#1: 21-Jan-2006, 08:08 PM

Testers

The Man Can!
Posts: 345

WWW
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!

#2: 23-Jan-2006, 02:44 PM

Mitch
Posts: 234

Very cool tip, will save me a lot of time. Thanks.

#3: 23-Jan-2006, 03:07 PM

Marketing & Design Team

davidm
MODx evangelist
Posts: 7,073

The best way to predict the future is to invent it

WWW
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...
.: nodeo.net : Pour un web libre, moderne et ouvert ! :: david-molliere.net : Suivez en "live" mes expérimentations et billets sur les CMS et autres applications web :.

*** Forums modxcms.fr Participez à l'élaboration du site MODx francophone ! ***

! Nouveau !  En live, ne manquez pas les news de modxcms.fr sur Twitter   ! Nouveau !

MODx est l'outil idéal pour les developpeurs et webdesigners qui cherchent un framework de gestion de contenu hautement flexible et performant, tout en étant simple d'accès pour les utilisateurs finaux.

Config : Apache 2.2.8 - MySQL 5.0.67 - PHP 5.2.8 | Debian 4.0 (Etch)

Réalisations sous MODx : | pargade-notaires.fr | soleil.info | gican.asso.fr | michelez-notaires.com | amadom.gerondicap.com | jocelyne-violet.net

#4: 23-Jan-2006, 04:52 PM

Testers

Dimmy
Posts: 2,001

Я не говорю по-русски 私は日本語を話さない

WWW
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


#5: 23-Jan-2006, 05:36 PM

Marketing & Design Team

davidm
MODx evangelist
Posts: 7,073

The best way to predict the future is to invent it

WWW
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
.: nodeo.net : Pour un web libre, moderne et ouvert ! :: david-molliere.net : Suivez en "live" mes expérimentations et billets sur les CMS et autres applications web :.

*** Forums modxcms.fr Participez à l'élaboration du site MODx francophone ! ***

! Nouveau !  En live, ne manquez pas les news de modxcms.fr sur Twitter   ! Nouveau !

MODx est l'outil idéal pour les developpeurs et webdesigners qui cherchent un framework de gestion de contenu hautement flexible et performant, tout en étant simple d'accès pour les utilisateurs finaux.

Config : Apache 2.2.8 - MySQL 5.0.67 - PHP 5.2.8 | Debian 4.0 (Etch)

Réalisations sous MODx : | pargade-notaires.fr | soleil.info | gican.asso.fr | michelez-notaires.com | amadom.gerondicap.com | jocelyne-violet.net

#6: 24-Jan-2006, 03:50 AM

Guest
@davidm : could you integrate these infos in your awaited tutorial? Thanks.

#7: 24-Jan-2006, 05:29 AM

Marketing & Design Team

davidm
MODx evangelist
Posts: 7,073

The best way to predict the future is to invent it

WWW
Most definitely will... but this week I have two websites going online, pretty busy...
.: nodeo.net : Pour un web libre, moderne et ouvert ! :: david-molliere.net : Suivez en "live" mes expérimentations et billets sur les CMS et autres applications web :.

*** Forums modxcms.fr Participez à l'élaboration du site MODx francophone ! ***

! Nouveau !  En live, ne manquez pas les news de modxcms.fr sur Twitter   ! Nouveau !

MODx est l'outil idéal pour les developpeurs et webdesigners qui cherchent un framework de gestion de contenu hautement flexible et performant, tout en étant simple d'accès pour les utilisateurs finaux.

Config : Apache 2.2.8 - MySQL 5.0.67 - PHP 5.2.8 | Debian 4.0 (Etch)

Réalisations sous MODx : | pargade-notaires.fr | soleil.info | gican.asso.fr | michelez-notaires.com | amadom.gerondicap.com | jocelyne-violet.net

#8: 28-Feb-2006, 01:20 PM

Marketing & Design Team

davidm
MODx evangelist
Posts: 7,073

The best way to predict the future is to invent it

WWW
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...
.: nodeo.net : Pour un web libre, moderne et ouvert ! :: david-molliere.net : Suivez en "live" mes expérimentations et billets sur les CMS et autres applications web :.

*** Forums modxcms.fr Participez à l'élaboration du site MODx francophone ! ***

! Nouveau !  En live, ne manquez pas les news de modxcms.fr sur Twitter   ! Nouveau !

MODx est l'outil idéal pour les developpeurs et webdesigners qui cherchent un framework de gestion de contenu hautement flexible et performant, tout en étant simple d'accès pour les utilisateurs finaux.

Config : Apache 2.2.8 - MySQL 5.0.67 - PHP 5.2.8 | Debian 4.0 (Etch)

Réalisations sous MODx : | pargade-notaires.fr | soleil.info | gican.asso.fr | michelez-notaires.com | amadom.gerondicap.com | jocelyne-violet.net

#9: 23-Mar-2006, 03:41 PM

Emeritus
Djamoer
Posts: 1,495

No one can limit a man other than the man himself.

WWW
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

#10: 25-Mar-2006, 09:36 AM

Tristan
Posts: 39

Hi,

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

#11: 25-Mar-2006, 07:30 PM

Foundation

OpenGeek
MODx Co-Founder
Posts: 6,949

damn accurate caricatures...

WWW
Please see http://modxcms.com/moving-sites-to-new-servers.html for the main instructions on moving sites to new servers; I'll see if I can't get someone on the doc team to update the page for us, to include the tip information.
Jason Coward
MODx Co-Founder
xPDO Founder
CTO @ Collabpad
work productively.
work intelligently.
work together.
Light is just a vibration of a note too. Everything is. You've got to keep that in mind.
  Frank Zappa

#12: 28-Jul-2006, 11:02 AM

persepolis
Posts: 62

I let MODx generate the data, then the generated script will be executed in TOAD for MySQL. That is the way I transfer the data to the server and much more comfortable than phpMyAdmin because TOAD gives  alot of detailed messages when something goes wrong.
That is possible if you have a TCP-access to the server (depends on the provider).

By the way I have 2 proposals
  • How about a further option just to truncate the tables and build the INSERT-statements ? Not every time it is needed to generate the the tables again.
    I have some trouble because the MySQL version of the server is older than the version I use locally - so I have to search for certain parts of the CREATE-statement to be changed.
  • What about to generate the Log-Tables but without INSERT statements ? They make the file very large and they are not needed every time.
Pages: [1]   Go Up
0 Members and 1 Guest are viewing this topic.