Page 2 of 2

Re: Please Help: Change Config for CMS Install w/ Subdirectories

Posted: Mon Feb 15, 2010 3:26 am
by replytomk3

Re: Please Help: Change Config for CMS Install w/ Subdirectories

Posted: Mon Feb 15, 2010 3:27 am
by kendo451
If you control the hosting for both accounts, here is my suggestion.

1. Notify the client that you will be moving the site to the main domain on a certain day and time.  Best day and time would be their lowest weekly traffic time.

2. Set up the main domain for the site with the hosting company a few days in advance but don't change the DNS yet.  You are going to create the files and database on the new site so that it is ready for the DNS change.

3. Upgrade your site to the latest version of CMS Made Simple and all modules.

4. If you have SSH access then zip or gzip the entire site and copy the zip file to the new site using WGET or FTP.

If you do not have SSH access, then use the tool provided in the control panel to zip it.

If you do not have SSH or a zip tool in the control panel, then use FTP to download the uploads directory and the modules directory, and then upload these to the new site.  (This takes forever, so you only need the modules and uploads directories for the method suggested here.  If you have your template images in the images dir, then you will need that as well.)

Problem: How do you upload files to a site that you haven't pointed the DNS at yet?
ANSWER: You can use the IP address instead of ftp.domain.com and as long as you have the right username and password the files will go to the correct site, even if it is a shared hosting account.

5. On the control panel of your old site, go to the PHP MY ADMIN for you database.  Click the database name in the left panel.  In the right panel click "Export".  Click the "select all" to select all tables.  Then check the box to export as a file.  It doesn't matter if it is gzipped or not.  Then click "Go" and save the file somewhere on your local machine.

6. On the control panel for your new site, go to databases, and create a database with the same name, username, and password as the old site.  After it has been created, go to PHP MY ADMIN and click the database name in the left panel.  In the right panel, click "Import".  Select the database file from your local machine and click Go.  It will tell you if the import was successful or unsuccessful.

7. Open your config.php in your file editor.  We are going to do find and replace.

First look at the old path. It will look like this on Plesk:

/var/www/vhosts/olddomain.com/httpdocs

or this if you're on Cpanel

/home/oldomain.com/public_html/

You want to do a find/replace operation where you replace

the path up to olddomain.com to replace it with newdomain.com

8. Now you also need to change the URL:

Find the line:
$config['root_url'] = 'http://www.olddomain.com';

change it to 'http://www.newdomain.com';

9. If your new database has the exact same dbname and username as the old one, then you need not change anything else. However, if you are on the same shared host, you probably had to change the database name and username.  If that is the case find these two lines in config.php and change them to the new db username and password:

$config['db_username'] = 'oldname';
$config['db_password'] = 'oldpassword';
$config['db_name'] = 'oldname';

10. On your new site hosting account, use wget or ftp to download the same version of CMS Made Simple that the old site is on.  Untar or unzip this file.  If you have SSH access the command is tar -zxf filename.tar.gz .  Then recursively change the permissions of tmp, uploads and modules to 775. For explicit details see this:
http://wiki.cmsmadesimple.org/index.php/User_Handbook/Installation/Shell_Install

NOW your site has the correct files, and the correct database. Double check to make sure that your .htaccess file was copied over and change any domain specific strings to the new domain.

11.  In your new site, test the site using the site preview.  This won't work for clicking links but if you can see the main page ok, then you're probably golden.

12. If you can edit the DNS zone for the old site, change the A and MX records so the site points at the IP address of the new site.  This will ensure the old site forwards to the new one.

13. Now prepare to change the DNS on the nameservers to point at your new site.  If you are hosting email on this domain you may want to make some changes so that the email will not be interrupted during the switch.  Main things to make sure are that the SPF includes the ip address of the new site, and that the old nameserver directs mail to the ip address of the new site.  (Let me know if you need more details on that.)  If you've made your preparations, you can switch the DNS and let it pop over to the new site.

CAVEATS:

If you are using a live ordering system then the best thing is to make the old and new site have "site down" until the DNS propagation has completed.  This will prevent and order being made on the old system that doesn't get carried over to the new one.

Re: Please Help: Change Config for CMS Install w/ Subdirectories

Posted: Mon Feb 15, 2010 3:34 am
by kendo451
I have found that the biggest problem with moving a site to a new server is client EMAIL.  Moving a site is pretty simple once you've done it a couple of times.  Moving a domain without interrupting the email is tricky - especially if the old site has SPF spam blocking enabled.

Database - move it last

Posted: Mon Feb 15, 2010 3:45 am
by kendo451
One more thing:

If the site is taking live orders these are in the database. So the database is the last thing that you want to move, and you want to move it after you have changed the setting to "site down" on the old site.  This way no new orders get posted while you are moving the site.

It is a good idea to copy the database and use either site preview or ip address to view the new site to make sure it is working properly BEFORE you switch the DNS.

However, you will want to move the database again after you've changed the site down settings to make sure you don't lose any orders.

Does that make sense for you?

Re: Please Help: Change Config for CMS Install w/ Subdirectories

Posted: Mon Feb 15, 2010 7:33 am
by Rolf
dcleckley wrote: I viewed the source code there after you mentioned it.  But I have no iframe and no index.html in the CMS folder.  It may be something that GoDaddy does when you forward and mask your domain.

I just have www.gullytvglobal.com forwarded and masked to www.stellarbeats.com/gullytv.  Thats it.
I should contact the host first now.

Putting a website in an iFrame isn't what I expect when you are talking about 'forwarding'...  :-\
I am sure SearchEngines won't like it too!

Regards, Rolf

Re: Database - move it last

Posted: Mon Feb 15, 2010 8:49 am
by dcleckley
kendo451 wrote: One more thing:

If the site is taking live orders these are in the database. So the database is the last thing that you want to move, and you want to move it after you have changed the setting to "site down" on the old site.  This way no new orders get posted while you are moving the site.

It is a good idea to copy the database and use either site preview or ip address to view the new site to make sure it is working properly BEFORE you switch the DNS.

However, you will want to move the database again after you've changed the site down settings to make sure you don't lose any orders.

Does that make sense for you?
Thank you.  Yes, it all makes sense.  I think that what will make it easier is that all will take place at godaddy, and not between hosts.  So, I can simply create a new hosting account, complete your steps and simply move the domain name from one acct to the other.

This makes sense. 

Rolf made a good comment though.  He noted that there might be a problem at GoDaddy that I may have to resolve first before moving forward.  Thank you all for your support.  I'll start with making sure all is well at the host.

Re: Please Help: Change Config for CMS Install w/ Subdirectories

Posted: Mon Mar 01, 2010 7:15 am
by dcleckley
Hello all.  I am writing to report what I did to resolve this issue.

It turns out that there was a problem at the host, GoDaddy.  The forwarding of the address with the mask caused an issue where there was an iframe created as Rolf stated.  So to resolve the issue, I requested the ability in functionality to manage the domain by 'attaching it' directly to the folder (gullytv) or (baybreeze) instead of forwarding to it.  Essentially, I have a deluxe acct that allows me to host as many domains as I'd like (a mini Host). 

Once I linked the domains, I turned off the forwards and the with the masks.  I then simply changed the root domain in the config.php to www.baybreeze.com or www.gullytvglobal.com respectfully.  Once this step was completed, I had to change my hand-made links to (example) www.baybreeze.com/sxlxjlo.html, instead of www.stellarbeats.com/baybreeze/sxlxjl.html.  All CMS Self Links auto update when you change the root url in the config.php. 

I hope that I wrote this clearly enough for others who visit forum.  I could not have done this without the help of the community that exists here.  Thanks to all who worked this post!!!!