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.
files
templates
composer.json
composer.lock
If you still have old extensions within system/modules/
or if you have created a config.yml
in the directory config/
or before Contao 4.8 app/config/
or if you created Contao adjustments under contao/
or before Contao 4.8 app/Resources/contao/
then they have to be transferred to your server as well.
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.json
and 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 benutzername@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: example.com
points to the directory /www/example/web
Pro Contao installation therefore requires a separate (sub)domain.
You have logged on to your server with your user name and domain.
ssh benutzername@example.com
To do this, change to the directory on the console where you want to install Contao.
cd www/example/
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 update
,
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.