How to Move Mautic to Another Server

Written by
on September 21, 2018

So you have Mautic running on your web server along with your website, but now you need to move Mautic along with your website to a new server? Good news! Migrating Mautic to another server is a walk in the park.

The instructions below are going to show you how to dump the mysql database from the command line in Debian/Ubuntu, import to a new db and migrate your Mautic installation. Let’s get to it!

Export Your MySQL Database

Assuming the name of your database is ‘mymautic’ and your username is ‘henry’ type the following at the command line:

mysqldump -u henry -p mymautic > whateveryouwant.sql

The – u signifies ‘username’ and the -p signifies ‘password’ which you’ll be prompted for after entering in the above.

The contents of your database will now be in the ‘whateveryouwant.sql’ file, and that will most likely be in your server /root/ directory. Not the server root, but the ‘root’ directory — That tripped me up in the past!

Create New Database & User

Create a new database on the new server. Sign into MySQL:

mysql -u root -p

Then type in the following, assuming you’re going to use the same db name and user name as above (you don’t have to):

create database;

And to grant access:

grant all on mymautic.* to ‘henry’ identified by ‘put-a-tough-password-here’;

Be sure to actually use the single quotes in the command above. Now you’re ready to import.

Import to New Database

It’s time to import. Copy the ‘whateveryouwant.sql’ file to the same /root/ directory on the new server. Then type:

mysql -u henry -p -h localhost mymautic < whateveryouwant.sql

Copy Mautic Files

Nice! The hardest part of your Mautic migration is done. Now copy your Mautic sub folder to the same place on your new server. Once the copy is finished, make sure www-data has proper rights. Assuming Mautic is contained in a ‘content’ folder, type in the following:

chown -R www-data:www-data /var/www/

Your Mautic migration is almost done!

Edit Config File & Clear Cache

Open the /content/app/config/local.php file and update the database name, user and password (if different). Then delete the /content/app/cache folder.

Make sure your nginx server block file is configured to look in the right folder and you’re ready to go. See installing Mautic in a subfolder for more information.

That’s it! As promised, moving Mautic to another server is a walk in the park!

97 thoughts on “How to Move Mautic to Another Server

  1. You my also need update the local.php file configuration to update the path of the site on the new server. (Cache dir, logs dir….)

  2. Pingback: canada pharmacies
  3. Pingback: canadadrugs
  4. Pingback: canadian viagra
  5. Pingback: pharmacy
  6. Pingback:
  7. Pingback: canada medication
  8. Pingback:
  9. Pingback: canada medication
  10. Pingback:
  11. Pingback:
  12. Pingback: canada viagra
  13. Pingback: canadian drugs

Leave a Reply to Fernando Cancel reply

Your email address will not be published.

UkuuPeople vs Follow Hook;
September 9, 2020
SEO Tips;
November 5, 2019
The Best iPhone Rig;
August 27, 2019
The Right Domain Name;
June 18, 2019
Outer Gain