Hi all
I have 4 instances of mautic working on production.
Anyone knows how to move/copy safe for example one form or one email from 1 instance to the other?
This is to avoid to have to recreate again the same form or email 4 times
Thank you in advance for your help
JR
Hi,
- emails are stored in the table called emails - if know mysql, that should not be a problem. Make sure, that the templates your emails based on are also moved. MJML emails are stored in bundle_grapesjsbuilder table
- themes are in the /themes folder. You’ll need to make sure all relevant themes are moved as well.
Forms - the same thing. You need to go into the DB and copy the forms table. Make sure to adjust form actions manually.
I assume that the Mautic version of the sql export and sql import should be the same ot there is a risk of that the DDBB will not work after the import right?
These tables are pretty much the same I think.
Hi joeyk
Do you know where I can find the tables description in the database. I would like to know what is the content of each table.
I am experiencing a failure trying to restore the DB because a problem with the email_stats and it is opened a problem with the hosting company but after few days they are did not answer yet. I would like to recover some of the info needed like contacts, segments, campaigns etc
This is the error the hosting company is looking to solve
[Errno 1] b"ERROR 3105 (HY000) at line 2434 in file: ‘/var/lib/mysql/import-jm41423-001-marketingesdb-202203030807/marketingesdb-202203030807’: The value specified for generated column ‘generated_sent_date’ in table ‘email_stats’ is not allowed."
Thank you
I dont have description of each column, but the db has certain data restrictions. They are described in the table itself. I believe the column you mentioned is a datetime format.
Yes… I receive the following changes in the database to restore it, but I do not know how to execute the first 2 lines. I got an error when executed as SQL in phpmyadmin
sed -i ‘s/(generated_sent_date
date).+/\1,/’ dump.sql
sed -i ‘s/(generated_email_domain
varchar(255)).+/\1,/’ dump.sql
ALTER TABLE email_stats DROP column generated_sent_date;
ALTER TABLE email_stats ADD generated_sent_date date GENERATED ALWAYS AS (concat(year(date_sent
),_utf8mb4’-’,lpad(month(date_sent
),2,_utf8mb4’0’),_utf8mb4’-’,lpad(dayofmonth(date_sent
),2,_utf8mb4’0’))) VIRTUAL COMMENT ‘(DC2Type:generated)’;
ALTER TABLE email_stats DROP column generated_email_domain;
ALTER TABLE email_stats ADD varchar(255) COLLATE utf8mb4_unicode_ci GENERATED ALWAYS AS (substr(email
,(locate(_utf8mb4’@’,email
) + 1))) VIRTUAL COMMENT ‘(DC2Type:generated)’;
Hi @jribeiro,
To do this I would use the Mautic API.
If your email comes from an external source and you want to create it identically on X Mautic instances: Mautic Developer Documentation
If you want to retrieve an existing email in an instance: Mautic Developer Documentation
Do you think this can answer your request?
Pierre
I think he is talking about emails as “emails to send” and the email stats table, that holds all related stats.
Yes the problems is that the hosting company needs to make manually the changes on the tables with generated values to allow mySQL to be restored.
These are the changes that be performed by them and then execute de SQL sentences to allow to restore the database
They said that this is a mySQL problem
Hello @jribeiro,
That’s why I’m telling you that the most “secure” way to do this is to use the Mautic API and not SQL queries with manual modifications that are error prone.
Pierre
@pierre_a Could you please give me an example about how to backup the Mautic database using the API?
Hello @jribeiro,
It is not possible to make a backup of the database via the API (it is not intended for that).
If you want to migrate an e-mail from one Mautic instance to another you can :
- Retrieve the e-mail in the first instance: Mautic Developer Documentation
- Create the e-mail in the second instance: Mautic Developer Documentation
I hope this will help you.
Have a nice day,
Pierre