This is the documentation for concrete5 version 5.6 and earlier. View Current Documentation

Move a concrete5 site

At its most basic, a concrete5 install is just a database and a file folder. Moving a site does take a little finesse, unfortunately. This is easiest to do if you have SSH or command line access to both hosts, but it's also fairly easy with phpMyAdmin and cPanel. If you don't have cPanel, most webhosts have some sort of administrative interface that will let you mess with your files and also create and extract archives. If you only have FTP access, you may need to contact your web host's support and get them to help you out.

There are five main steps to moving a site:

  1. Get a copy of the database.
  2. Get the correct files.
  3. Put your files in the new environment.
  4. Create a new, empty database in the new environment and import the exported database from the first step.
  5. Modify your configuration file for the new site.

note: This guide assumes that concrete is installed at /home/your_account/public_html/ on a *nix machine. The technique is still valid wherever your site is installed.

Make A Database Copy

There are a number of ways to get a database copy. phpMyAdmin has an "export" function, if you are unfamiliar with phpMyAdmin, youtube actually has some good tutorials.

This command will also give you a good backup if you have ssh:

 mysqldump -u db_user -p db_database > database.sql

That will create a file in SQL format. You will use this file later, to re-create your site in its new home.

Get The Files

As you know, concrete5 has plenty of files. Unsurprisingly, you want most of them on your new site. Here are the ones you can ignore:

  • files/cache/
  • files/tmp/
  • updates/

If you cleared your cache beforehand, the cache folders should have nothing or almost nothing in them. You definitely do not want old cache on your new site.

Do not delete the updates folder while your current site is still "live". If there is anything in it, the highest numbered version of concrete5 in that folder is the version your site is actually running. Your site's config/site.php will have a constant DIRNAME_APP_UPDATED defined that should match the name of the folder. Write that down.

To actually create your site archive, the easiest thing to do is to copy your entire public_html/ folder over to something like copied_site/ and then you can remove those three folders from copied site and create your archive. cPanel's File Manager lets you create an archive, and you can also do so from the command line with tar czfv site_copy.tgz copied_site/.

Now download the archive to your machine.

Move The Files

On your new hosting environment, upload, then extract your archive so that the file structure of public_html/ matches the one on your existing site. Once that's ok, you may need to modify the permissions of these folders:

  • files/
  • packages/
  • updates/
  • config/
  • sitemap.xml

All of these files will need to be writable by the webserver, just like doing a new install. Generally this means making them read / write / execute allowed for owner / group / world. This can be done with the command line with chmod -R a=Xrw files/ packages/ updates/ config/ sitemap.xml or with cPanel's File Manager.

Make sure the new site has the right version of the core concrete5 software. To do this, you can download the version of concrete5 listed in your config file and extract it into updates/. If your site was not running off of an update, then you can just use the version that is in your concrete/ folder.

Another option is to copy the version of concrete5 that you site is running into the public_html/concrete/ folder for your new site, and not putting anything in updates, and delete the entry for DIRNAME_SITE_UPDATED in config/site.php

New database

Now you need to create a new, empty database on the new hosting environment for your site to run. This can be done through phpMyAdmin.

Once you have the new database in place, you can now import the data either using phpMyAdmin by uploading your database dump from earlier and using phpMyAdmin's import function, or just use this command:

 mysql -u db_user -p database_name < old_database.sql

Now you should have all of your files and data in place.

Update configuration

The last step is to modify your config/site.php file so that DB_SERVER, DB_USERNAME, DB_PASSWORD, and DB_DATABASE are correct for your new server. Now you should be able to browse the new site and everything will work.

Testing

Make sure you can do these tasks before considering this done:

  1. Clear the cache from the dashboard.
  2. Upload a file in the file manager.
  3. Run the "Automated Jobs" (search 'jobs' in dashboard search to get the page)
  4. Test page edits (make sure you can edit a page, do versions etc)

Troubleshooting

  1. Can't upload files or run jobs. Make sure you set the permissions correctly when you moved the files over.
  2. Can't connect to database. Incorrect settings in config/site.php, or the database does not exist.
  3. Broken links. Did the old site have Pretty URLs enabled? Make sure that your .htaccess file is in place and correct for your hosting environment.
Loading Conversation