Correct Way of Moving Concrete5 Site
Permalink
Hi All,
I'm having issues with putting my site from one server to another. The reason for doing this is that I was on a 123 package which wasnt suitable for concrete5 and I have now swapped to the business server from 123. This was due to server response time through Google site speed etc.
My issues:
1) The site on the old server is Currently Running 5.6.3.1, however there has now been a concrete5 update 5.71. Do I update it on the old server first before transferring it over?
2) Using 123, do I install it through them or is it best to manually install it as I will be transferring files from the old server?
3) I've made a copy of the current websites database, with the pretty urls turned off and cache deleted, is this the best practice or am I missing something?
4) I've tried manually transferring the files, which worked, but within the site.php file, it was still pointing to the old database and when changing to the new servers database, the site was not working.
Any advice or tips will be appreciated!
I'm having issues with putting my site from one server to another. The reason for doing this is that I was on a 123 package which wasnt suitable for concrete5 and I have now swapped to the business server from 123. This was due to server response time through Google site speed etc.
My issues:
1) The site on the old server is Currently Running 5.6.3.1, however there has now been a concrete5 update 5.71. Do I update it on the old server first before transferring it over?
2) Using 123, do I install it through them or is it best to manually install it as I will be transferring files from the old server?
3) I've made a copy of the current websites database, with the pretty urls turned off and cache deleted, is this the best practice or am I missing something?
4) I've tried manually transferring the files, which worked, but within the site.php file, it was still pointing to the old database and when changing to the new servers database, the site was not working.
Any advice or tips will be appreciated!
Sorry,
Forgot to mention its a new domain also.
I literally just want to put an old site on a new server and domain. But with a new SQL table
Forgot to mention its a new domain also.
I literally just want to put an old site on a new server and domain. But with a new SQL table
Oh, that makes more sense.
Here's a step-by-step I use:
On the old server...
1) Turn off Pretty URLs
2) Turn off all c5 caching
3) Clear the c5 cache
4) Delete all files inside the file/cache so you have empty 'cache' folder.
5) From the host's cPanel->File Manager, select all your files in the root and choose 'Compress' from the File Manager's menu. If you have uploaded or created non-concrete5 files and folders then you need to decide which of these folders need to be moved to the new server.
6) Download the resulting zip file.
7) Using your host's phpMyAdmin functions, export your active concrete5 database (as defined in the site.php file) to your local computer.
On the new server...
1) Using the new host's phpMyAdmin, create a new, blank database. Write down the database name, user name and password you used to create this database.
2) In that new database, import the SQL file you exported from your old site.
3) Upload the zip file of your site to the root of your new server and use the cPanel's File Manager to 'Expand' the zip.
4) Open the config/site.php file and change the database information to match the info used to create the new database. Make sure you change the 'DB_SERVER' line to point to your new server's database location. Normally it's 'localhost' but it might be something completely different from your old server.
4) Rename the existing .htaccess file to '.htaccessOLD'
5) Create a new, blank .htaccess file.
6) Transfer any needed commands from the .htaccessOLD file over to your new .htaccess file but DON'T copy the Pretty URL stuff that concrete5 creates. There may be some domain-specific stuff from your old .htaccess file that you need to adjust for your new domain.
7) Visit your new site and reset the Pretty URLs
Life is good again.
Here's a step-by-step I use:
On the old server...
1) Turn off Pretty URLs
2) Turn off all c5 caching
3) Clear the c5 cache
4) Delete all files inside the file/cache so you have empty 'cache' folder.
5) From the host's cPanel->File Manager, select all your files in the root and choose 'Compress' from the File Manager's menu. If you have uploaded or created non-concrete5 files and folders then you need to decide which of these folders need to be moved to the new server.
6) Download the resulting zip file.
7) Using your host's phpMyAdmin functions, export your active concrete5 database (as defined in the site.php file) to your local computer.
On the new server...
1) Using the new host's phpMyAdmin, create a new, blank database. Write down the database name, user name and password you used to create this database.
2) In that new database, import the SQL file you exported from your old site.
3) Upload the zip file of your site to the root of your new server and use the cPanel's File Manager to 'Expand' the zip.
4) Open the config/site.php file and change the database information to match the info used to create the new database. Make sure you change the 'DB_SERVER' line to point to your new server's database location. Normally it's 'localhost' but it might be something completely different from your old server.
4) Rename the existing .htaccess file to '.htaccessOLD'
5) Create a new, blank .htaccess file.
6) Transfer any needed commands from the .htaccessOLD file over to your new .htaccess file but DON'T copy the Pretty URL stuff that concrete5 creates. There may be some domain-specific stuff from your old .htaccess file that you need to adjust for your new domain.
7) Visit your new site and reset the Pretty URLs
Life is good again.
mhawke - I notice this comes up as a question often enough in the forums that you should turn this into a How-To.
There's already this page in the documentation:
http://www.concrete5.org/documentation/installation/moving_a_site...
http://www.concrete5.org/documentation/installation/moving_a_site...
Thanks for this,
However, when I change the site.php to the new database details, the site doesnt work, however it does with the old details?
However, when I change the site.php to the new database details, the site doesnt work, however it does with the old details?
Also,
When I try to restore the backup of the exported database from the old server, I get the following error:
ERROR 2005 (HY000): Unknown MySQL server host 'cust-mysql-123-21' (0)
When I try to restore the backup of the exported database from the old server, I get the following error:
ERROR 2005 (HY000): Unknown MySQL server host 'cust-mysql-123-21' (0)
Fixed this, this was due to trying to using the restore function in 123 rather than going into phpadmin
I added some more detail to my step-by-step list above. You mention that the DB_SERVER was 'cust-mysql-123-21' so you might need to adjust this line in the new site.php to make sure it points to your new server's database location.
phpMyAdmin is the only backup/restore I use. I don't trust my host's automatic backup/restore features or concrete5's internal backup/restore functions. Sometimes they don't work. phpMyAdmin rarely gives me trouble unless my server is really busy and everything is taking so long that even phpMyAdmin times out when trying to create a large backup.
phpMyAdmin is the only backup/restore I use. I don't trust my host's automatic backup/restore features or concrete5's internal backup/restore functions. Sometimes they don't work. phpMyAdmin rarely gives me trouble unless my server is really busy and everything is taking so long that even phpMyAdmin times out when trying to create a large backup.
I agree, phpAdmin was also playing up for me whilst trying to do this. It would keep logging me out during the import, but resolved this by using morzilla instead of Chrome. How odd!
phpMyAdmin is subject to the same server resource limitations as any other php. For a big import, it is not unusual to timeout.
A way round such limits is to use a text editor to break the .sql file up into smaller chunks and import each part in sequence.
A way round such limits is to use a text editor to break the .sql file up into smaller chunks and import each part in sequence.
Version 5.7 is NOT backwards compatible so you cannot simple 'upgrade' before you move your site. You will need to rebuild your site from scratch in 5.7. Please don't shoot the messenger.
Can't 123 move your site for you? I've never been with a host that required me to physically move a site in order to upgrade my hosting plan.