What is the choice of backup when moving the site to a new doman

Your software
My Mautic version is:3.2
My PHP version is:7.3
My Database type and version is:mysql 5.7

Your problem
My problem is: Transferring a mautic system to a new domain and finding somethnig that will search and replace the urls to match the new domain.
What is every one using… I can see it may be no problem when the domain name stays the same since URLS will not need to be swapped… so please help if you have a solution that works.

Steps I have tried to fix the problem:
Of course Duplicator won’t work since its not wp… and I have found no other copier to work since all the urls and there are 20,000 + urls that need to be swapped to the new domain.

Hi @tommytx123
in my experience…
If you just want to change your domain,
edit file local.php at app/config
change the domain line
and make sure your domain IP or NS is correct

1 Like

Thanks for that ekatronik… but i am used to normal websites and when you change domains if you don’t search and replace 20,000+ domain urls to the new one you will have one heck of a mess. Are you saying that simply changing the config will rewrite all those URLS? Thanks for any clarification.

Rebuilding the cache will change the URLs.
In case you used any Static URL, you need to change that manually, but why would you.


Yes… just edit file “local.php”
and all URLS will rewrite…

Mautic use dynamic URLs, so on local.php you will find this syntax:

  'site_url' => 'https://your-new-domain.com',
  'webroot' => NULL,
  'cache_path' => '/home/user/public_html/app/../var/cache',
  'log_path' => '/home/user/public_html/app/../var/logs',
  'image_path' => 'media/images',
  'tmp_path' => '/home/user/public_html/app/../var/tmp',

put your new domain at ‘site_url’
and all your URLS will change, but do not edit _path line,
that mean… your domain will load mautic script on that path with your new domain…

after that rebuild the cache,
in case you use any static URL, like @joeyk mention it…
If you has custom thanks you page, for example old-domain.com/thanks-custom.html, so you have to find where you put that link on your mautic, maybe on your form redirect field or your email, or maybe landingpage, etc, so change it manually to new-domain.com/thanks-custom.html

sorry if my explanation confusing, my English bad :slight_smile:

1 Like

I would recommend that you put in place a wildcard redirect on your old domain to the new one as soon as you have moved Mautic to take into account the domain move. Any emails that you have already sent and that are in folks’ inbox will still have the old domain, so it would be good practice to make sure that they land up in the right place!

This whole process of moving domain would be a great topic for the Knowledgebase as I am sure that it will come up again - @tommytx123 maybe you could consider writing it up once you are done? Here are the contribution guidelines: Contribution | Grav


Thanks for that Joeyk… every little bit helps. I have been checking out your website that seems very helpful also.

Thanks for that additional input… deep detail like what you added is making this thread to go to for information… I really appreciate all of your input

Thanks for that… would love to write it up in very painful detail as when i tackle a problbem i go way into all the details about how to do it well…

Really appreciate all your help… and please like RcCheesly said… lets put enough bits and pieces into here so I can write it up like a big dog… so to expand this thread let me further explain exactly what is happening and what I am really trying to do…

  1. I want to make a dupe of my main site which is running 2.16 and has not responded well to converting to 3.2 so in concern for messing up my site what i would like to do is make a dupe of my main site… then change the domain name of the copy to a new temp name… then do what ever it takes to squash the 2.16 into a 3.+ mautic version or whatever it is at the time…Then once its working correctly with version 3.+ switch it back to its original domain name… I know it sounds crazy but look what a learning experience it will be…
    a. duping a site and change its domain name
    b. Installing via command line the latest version of Mautic
    c. Bringing it back thru another domain name change… to original…domain name with the version 3+ incorporated.

So another obstacle I see is bringing the dupe live under a new domain name… since if you restore the copy (all my sites are on the same server)… so concerned it might restore over the original since the original will be live and matches all the original url… so I need to restore to the new domain name and that may not work… like duplicator switchs the domain name as it builds… but not so with a restore from the cpanel or other restore system.

And worse getting access to make all the config changes on a dupe copy i don’t know how that will work… so this is a major learning process for most as I doubt many have ever attempted to do such a thing…
I am use to building normal websites and its simple to use duplicator to take a copy (dupe) of the old site… then simply tell dupe to switch all the urls and bingo you have a domain change in the blink of an eye… So if anyone understands what I am trying to accomplish jump in it would be greatly appreciated… beginning with the simplest way to dupe a site and get it operating on the new domain name…

Thanks that is extremely detailed help and fantastic for those like me who are just gettting familiarized… So let me ask another question… I can follow your converting the domain name of an existing site but what i need to do is get at a dead site…(a copy) so lets say i make a copy of the original site… using say softaculours… and while its laying there dead… do i have access to all the areas that i need to convert… so that when I wake it up or copy it to its new doamin it will wake up as the new domain name… I am concerned about just restoring it to the new domain name… first because I do not think cpanel or softaculours will allow htat… will they… I know duplicator will allow… but I am sure cpanel restore will not and not sure about softaculous… So bottom line is it possible to make the changes on the carcas (copy) so that when that copy is restore it will be sporting the new domain name…

Hi @tommytx123
In case you have a full backup of your mautic file, include the backup of whole sql file.
you only need to restore it on your new domain path at your hosting… of course not all cpanel provider allow to restore file from other backup… but you can do manually.

Let say you manage server with cpanel and softcoulous on it… this is what I have to do, but this not just a way.

  1. Install a new fresh mautic with softcolous on your domain. with this action, your cpanel will create a db name, db password, db user, and db table prefix, and fill that database with brand new mautic database table with all record.
  2. open file manager from cpanel, open the path that you install new mautic. go to app/config/ and find local.php file. then backup that file on your harddisk… or other place
  3. delete all file and folder of new mautic, and upload your backup file on that path, and extract that if still zip file…
  4. make sure, when you extract, all old file in correct path.
  5. go to PHPmyadmin, and select the new mautic database (you can find the db name on local.php) drop all the table of that dbase. and import your old sql in it.
  6. back to file manager, in path app/config/ delete local.php. then upload the new mautic local.php that was you backup. open it, and you have to change db table prefix, with your imported sql.
    OR, if you don’t want lost your old mautic configuration… just open old local.php, and change db prefix, db name, db user, db password, and make sure the path is correct.
  7. clean up cache folder at var/cache

That all step what I did when I move mautic to other subdomain, or maybe to other cpanel account.

Another case you can make it super manually, create manual sql db on cpanel, and then import with phpmyadmin.
after that extract your backup file on the path that you want. but make sure edit file local.php,

But it will difference way if you run VPS server with no control panel

thanks… sorry if I miss some step

1 Like

Thank you so very much… both explanations was exactly what I was looking for… you are the best… Thanks

Hate to keep bugging you, but it seems like you have done exactly what i want to do and so i have one more question please… Since I will be putting together an item for the knowledgebase… this may be important to make sure I do not leave out anyting.
Question: During the local.php review and while changing the Site:URL to my new domain name, I noticed several items of interest and wondered if i needed to make more changes…
I see things like logpath and mailer_from_email and noted that they will contain the email and domain of the old site… should any of those items need to be manually changed or will it happen automatically…I don’t see how they could change since those emails may or may not exist on the new domain depending on whether or not i have set them up yet.
also wondered about the secret key… will that still be valid… looks like more than site:URL will need to be changed or am i reading this wrong. Thanks again for all the help…

1 Like


Is a file that store all information of the mautic configuration. If you change configuration such as email send from, SMTP, time zone, and all configuration setting menu, this file will update automatically if you make change it.

at the beginning important, make sure your new domain and database connect properly, after that, you can login to you mautic, and set up configuration menu, and Save it (or Apply) and all configuration at local.php will change with your latest setting…

About email send from… of course you have to create a new one for new domain.
and can change after you login to mautic.

About how to configure mautic properly, may be we can start new chapter… :grinning: