Moving Contao installation to another server

Sometimes we have to move the website from one server to another or create a local development environment. In this article I will show you how to do it and which seems a best a good practice to do so.

Basically, the system consists of the CMS files and a database, usually a MySQL database. For backup and restore you need both a database dump and a backup of the filesystem, also the configuration must be changed to the new database system.

wordpress_filesystem_mysql

 

Moving the Contao files

First copy all CMS files from the system to the local filesystem, note that also the .htaccess file is being transferred.

Export Database

To backup the MySQL database, there are several ways and can be created with any SQL client or by a script. The Linux script for automatic backup I posted here some time ago. Also, any SQL client for backing up and restoring are used in this case I explain this using the MySQL client PhpMyAdmin.

Before the backup, you should perform system maintenance to reduce the amount of data when exporting, this unneeded records are removed from the database. For this purpose, we log in to the backend system and select the menu item “System Maintenance” from the “System” section:

contao_maintenance_clean_database

This action also deletes the search index which will be rebuilt manually or while opening the pages from the website.

Next, the database must be backup up using some backup options.

phpmyadmin_export_options1

Import Database

After the successful export of this database will be imported on the target system again. This is similar to the mi export any SQL client.

phpmyadmin_import

Modify configuration

Finally the configuration to the database needs to be adjusted, this works either by calling the Contao installation tools or by manual adjustment of the configuration file in system / config / localconfig.php. After the change, the page should now be working as desired, and in any case should be carefully checked that everything works fine.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">