This article is machine translated.
Moving a local installation to a live server is almost the same as a new installation.
To avoid inconvenience during the move, your local server should have the same PHP version as running on the live server.
The easiest way to create a MySQL dump is to use the database administration “phpMyAdmin”. Log in to “phpMyAdmin”, select the database you want to export and click the “Export” button in the upper menu.
Open “phpMyAdmin” on the target server and create a new database for Contao. Depending on the server configuration, this might only be possible via the administration interface (e.g. Confixx, Plesk or cPanel). Select the new empty database and click on the “Import” button in the upper menu. Then upload the SQL dump of the local database and start the import.
Before you can move Contao to your server, you need to install and configure the Contao Manager.
Open your FTP program and connect to your server. Copy the following files and folders from the localContao directory to the server.
If you still have old extensions or if you have created one
config.yml in the directory or
app/config/ in Contao 4.8 or later
config/, they have to be transferred to your server.
Log in to the Contao Manager. Call your domain with the extension
/contao-manager.phar.php and enter your access data.
The Contao Manager automatically detects the extensions you have stored in the root directory
composer.lock when you click on the “Install” button, the manager
composer install runs in the background and installs Contao and the extensions you used in the local installation.
The installation can now take several minutes. Details of the installation process can be displayed by clicking on the icon.
Open the Contao install tool and enter the access data for the new database.
The easiest way to create a MySQL dump on the command line is to use the following command followed by the password
mysqldump -h localhost -u Benutzer -p --opt Datenbankname | gzip -c > mysqldump.sql.gz
The file will be saved in the directory you are in when you send the command.
Now you can transfer the data
secure copy to your server.
scp -r /pfad/lokal/files/ /pfad/lokal/templates/ /pfad/lokal/composer.json /pfad/lokal/composer.lock /pfad/lokal/mysqldump.sql.gz email@example.com:server/www/example/
In Contao, all publicly accessible files are located in the subfolder
/web of the installation. Set the document root of the installation to this subfolder via the admin panel of the hosting provider and set up a database on this occasion.
example.compoints to the directory
Pro Contao installation therefore requires a separate (sub)domain.
You have logged on to your server with your user name and domain.
To do this, change to the directory on the console where you want to install Contao.
If Composer has not yet been installed, we will install it later.
In the next step you can import the MySQL dump with the following command followed by the password.
gunzip < mysqldump.sql.gz | mysql -h localhost -u Benutzer -p Datenbankname
After we have successfully completed all preparations, we install Contao with
composer install. Unlike the
install does not resolve any dependencies, they are located in the included
composer.lock. Therefore, this process
will not go wrong because the system requirements are too high.
php composer.phar install
Then open the Contao install tool and enter the access data for the new database.