Moving to Production Server

10 posts by 5 authors in: Forums > CMS Builder
Last Post: December 11, 2008   (RSS)

By InHouse - April 22, 2008

We will soon be moving our CMSB site from our sandbox server to the production one. Are there any recommended suggestions or known 'gotchas' that we need to address?

The one thing I'm concerned about is that the development site was in a sub-directory under the public_html folder. The production server will have the site posted at the public level. This means that all the internal references to images, uploads, internal links, etc. need to be updated. Sounds like several hours of SQL scrubbing. Any suggestions about this process?

Jayme

Re: [InHouse] Moving to Production Server

By Dave - April 22, 2008

You'll need to copy this data over:
- MySQL data (use phpMyAdmin, etc)
- /data/ folder (with schema files and settings)
- /uploads/ folder
- viewer files

Then you'll need to update these settings:
- Admin > General > Upload Dir
- Admin > General > Upload Url
- Any custom upload dirs in the field editor (if you've used those)
- The require_once "" path in any viewers (you can get this from the code generator on the live server or use a relative path that will be the same on both servers).

Finally, all the image paths are relative from the root of the website, but if that path has changed you'll have to either put the new the uploads folder in the same place as the staging server and/or update the values in the section and upload tables.

I think we could do a few MySQL UPDATE statements with the MySQL replace function to replace all the old paths with new ones. Let me know if I can provide some help with that.

We hadn't anticipated staging and production servers having different web paths, but it's come up a couple times now, so perhaps there's some kind of automated solution we can add to make updating that easier...

Let's go through this process, figure out anything else that's missing and I can create a doc page for it for future.

Hope that helps.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Moving to Production Server

By InHouse - April 22, 2008

Thanks Dave. Great info as usual. Nothing you've said comes as a surpise so that's really good news.

I'd be happy to have you keeping an eye on me during this process. Will be in touch regarding this.

Cheers,
J.

Re: [blukabm] Moving to Production Server

By Dave - August 28, 2008

Hi Troy,

I'd start with a clean install - this will create a user account for you to login with. Otherwise you'll need to move over your user accounts database.

Then upload your /data/schema/ folder which has all your section settings.

The click on Admin > Section Editors and CMS Builder will generate any database tables or fields that don't exist already.

Then upload your viewers. Note that the "require_once ..." line in the viewers might need to be changed. You can get the correct filepath for this from: Admin > Code Generator

And that should do it.

Hope that helps, let me know if you need anything else or if you run into any problems.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Moving to Production Server

By cmsweb - August 28, 2008

Glad I read this post. We're in the same boat with 2 new sites in production server that we'll need to move to a different location. Didn't realize the uploads were being referenced the way they are so we'll need to clean up the records before we migrate.

Re: [cmsweb] Moving to Production Server

By benedict - December 3, 2008

Hi Dave,

You mention above:

"Finally, all the image paths are relative from the root of the website, but if that path has changed you'll have to either put the new the uploads folder in the same place as the staging server and/or update the values in the section and upload tables. "

I have been working on the CMS in a subdirectory so all the links are showing companyname/cmsAdmin/uploads/headshot.jpg. In other words, all my images from the CMS are not appearing now.

I can't do the first option mentioned above, but the second option is possible, but to update the values in the section and upload tables - is this in the CMS or in PHPMyAdmin? Whereabouts do I find it?

Regards,

Benedict

Re: [benedict] Moving to Production Server

By Dave - December 5, 2008

Hi Benedict,

Yes, you'd have to use phpMyAdmin and do a search and replace on the data. You could do that for the uploads table as follows:

First, figure out the old path you want replace, in my example its: 'C:/wamp/www/'
Then figure out the new path you want, in my example its: 'X:/www/'

Here's the SQL to make the replacement:

UPDATE cms_uploads SET
filepath = REPLACE(filepath, 'c:/wamp/www/', 'X:/www/'),
urlpath = REPLACE(urlpath, 'c:/wamp/www/', 'X:/www/'),
thumbFilePath = REPLACE(thumbFilePath, 'c:/wamp/www/', 'X:/www/'),
thumbUrlPath = REPLACE(thumbUrlPath, 'c:/wamp/www/', 'X:/www/'),
thumbFilePath2 = REPLACE(thumbFilePath2, 'c:/wamp/www/', 'X:/www/'),
thumbUrlPath2 = REPLACE(thumbUrlPath2, 'c:/wamp/www/', 'X:/www/'),
thumbFilePath3 = REPLACE(thumbFilePath3, 'c:/wamp/www/', 'X:/www/'),
thumbUrlPath3 = REPLACE(thumbUrlPath3, 'c:/wamp/www/', 'X:/www/')


Hope that helps, don't forget to make a backup of your database first before making any changes.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Moving to Production Server

By benedict - December 9, 2008

Thanks Dave,

I got that to work for all my uploads - so that's all good. I have one remaining problem. The links in my Wysyiwg editors are all incorrect as well. Is it quicker to just go through and fix manually? I thought about this:

UPDATE cms_why_choose_ects SET
content = REPLACE(content, 'ects/', '')

But I'm pretty sure that is not right. Because my links are inside a WYSIWYG and not just a straight text field with a single result, can it not be done with PhpMYAdmin?

Re: [benedict] Moving to Production Server

By Dave - December 11, 2008

Hi benedict,

That looks right to me. The way to test it before you make any changes is with this query:

SELECT content, REPLACE(content, 'ects/', '') FROM cms_why_choose_ects

This will output two columns, the original on the left and the updated version on the right. You can then check it over to make sure it's what you want before you actually update the data with "UPDATE". Select only displays and won't make any changes.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com