Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add back the 2->3 upgrade docs #246

Open
wants to merge 5 commits into
base: 4.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
360 changes: 360 additions & 0 deletions docs/getting_started/how_to_update_mautic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,366 @@
php bin/console mautic:update:apply --finish


To Update Mautic from 2.x to 3.x
*********************************
If you are on Mautic 2.x + then it is better for you to upgrade to 3.x and higher version in this section let's deep dive into upgrading Mautic from 2.x to 3.x version.

Check warning on line 80 in docs/getting_started/how_to_update_mautic.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.Contractions] Feel free to use 'it's' instead of 'it is'. Raw Output: {"message": "[Google.Contractions] Feel free to use 'it's' instead of 'it is'.", "location": {"path": "docs/getting_started/how_to_update_mautic.rst", "range": {"start": {"line": 80, "column": 33}}}, "severity": "INFO"}

Check warning on line 80 in docs/getting_started/how_to_update_mautic.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.We] Try to avoid using first-person plural like 'let's'. Raw Output: {"message": "[Google.We] Try to avoid using first-person plural like 'let's'.", "location": {"path": "docs/getting_started/how_to_update_mautic.rst", "range": {"start": {"line": 80, "column": 107}}}, "severity": "WARNING"}

Getting Started !

.. note::

if you are not already operating with elevated privileges or have not set up the necessary permissions in your system configuration, you may be able to run these commands with SUDO.

Check warning on line 86 in docs/getting_started/how_to_update_mautic.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.Contractions] Feel free to use 'aren't' instead of 'are not'. Raw Output: {"message": "[Google.Contractions] Feel free to use 'aren't' instead of 'are not'.", "location": {"path": "docs/getting_started/how_to_update_mautic.rst", "range": {"start": {"line": 86, "column": 12}}}, "severity": "INFO"}

Check warning on line 86 in docs/getting_started/how_to_update_mautic.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.Contractions] Feel free to use 'haven't' instead of 'have not'. Raw Output: {"message": "[Google.Contractions] Feel free to use 'haven't' instead of 'have not'.", "location": {"path": "docs/getting_started/how_to_update_mautic.rst", "range": {"start": {"line": 86, "column": 66}}}, "severity": "INFO"}

Check warning on line 86 in docs/getting_started/how_to_update_mautic.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.Acronyms] Spell out 'SUDO', if it's unfamiliar to the audience. Raw Output: {"message": "[Google.Acronyms] Spell out 'SUDO', if it's unfamiliar to the audience.", "location": {"path": "docs/getting_started/how_to_update_mautic.rst", "range": {"start": {"line": 86, "column": 181}}}, "severity": "INFO"}

1. Step One : Fix the data migrations, in your current Mautic repository path execute the below commands inside (cd /path/to/your/Mautic) :

Check warning on line 88 in docs/getting_started/how_to_update_mautic.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.Colons] ': F' should be in lowercase. Raw Output: {"message": "[Google.Colons] ': F' should be in lowercase.", "location": {"path": "docs/getting_started/how_to_update_mautic.rst", "range": {"start": {"line": 88, "column": 13}}}, "severity": "WARNING"}

.. code-block:: shell

php app/console doctrine:migration:migrate

php app/console doctrine:schema:update --force

sudo -u www-data php app/console cache:clear

The cache clear may take some to get executed.

After the Migration is done we can go ahead and update the Database !

Check warning on line 100 in docs/getting_started/how_to_update_mautic.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.Passive] In general, use active voice instead of passive voice ('is done'). Raw Output: {"message": "[Google.Passive] In general, use active voice instead of passive voice ('is done').", "location": {"path": "docs/getting_started/how_to_update_mautic.rst", "range": {"start": {"line": 100, "column": 21}}}, "severity": "INFO"}

Check warning on line 100 in docs/getting_started/how_to_update_mautic.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.We] Try to avoid using first-person plural like 'we'. Raw Output: {"message": "[Google.We] Try to avoid using first-person plural like 'we'.", "location": {"path": "docs/getting_started/how_to_update_mautic.rst", "range": {"start": {"line": 100, "column": 29}}}, "severity": "WARNING"}

2. Upgrade to 2.16.5 (If you haven't yet) :

Check warning on line 102 in docs/getting_started/how_to_update_mautic.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.Parens] Use parentheses judiciously. Raw Output: {"message": "[Google.Parens] Use parentheses judiciously.", "location": {"path": "docs/getting_started/how_to_update_mautic.rst", "range": {"start": {"line": 102, "column": 22}}}, "severity": "INFO"}

.. code-block:: shell

cd /path/to/your/mautic

sudo -u www-data php app/console mautic:update:find

sudo -u www-data php app/console mautic:update:apply


3. Upgrade the to PHP 7.3 version :

.. code-block:: shell

apt upgrade -y

apt install software-properties-common -y

add-apt-repository ppa:ondrej/php

apt update -y

apt install php7.3

apt install php7.3-common php7.3-mysql php7.3-xml php7.3-xmlrpc php7.3-curl php7.3-gd php7.3-imagick php7.3-cli php7.3-dev php7.3-imap php7.3-mbstring php7.3-opcache php7.3-soap php7.3-zip php7.3-intl -y

4. Edit Your PHP INI file :

Check warning on line 129 in docs/getting_started/how_to_update_mautic.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.Acronyms] Spell out 'INI', if it's unfamiliar to the audience. Raw Output: {"message": "[Google.Acronyms] Spell out 'INI', if it's unfamiliar to the audience.", "location": {"path": "docs/getting_started/how_to_update_mautic.rst", "range": {"start": {"line": 129, "column": 18}}}, "severity": "INFO"}

.. code-block:: shell

sudo nano /etc/php/7.3/apache2/php.ini

Find the following attributes and change the values of the below variables as shown below:

- `short_open_tag = On`

Check failure on line 137 in docs/getting_started/how_to_update_mautic.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'short_open_tag'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'short_open_tag'?", "location": {"path": "docs/getting_started/how_to_update_mautic.rst", "range": {"start": {"line": 137, "column": 4}}}, "severity": "ERROR"}
- `memory_limit = 256M`

Check failure on line 138 in docs/getting_started/how_to_update_mautic.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'memory_limit'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'memory_limit'?", "location": {"path": "docs/getting_started/how_to_update_mautic.rst", "range": {"start": {"line": 138, "column": 4}}}, "severity": "ERROR"}
- `upload_max_filesize = 100M`

Check failure on line 139 in docs/getting_started/how_to_update_mautic.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'upload_max_filesize'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'upload_max_filesize'?", "location": {"path": "docs/getting_started/how_to_update_mautic.rst", "range": {"start": {"line": 139, "column": 4}}}, "severity": "ERROR"}
- `max_execution_time = 300`

Check failure on line 140 in docs/getting_started/how_to_update_mautic.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'max_execution_time'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'max_execution_time'?", "location": {"path": "docs/getting_started/how_to_update_mautic.rst", "range": {"start": {"line": 140, "column": 4}}}, "severity": "ERROR"}
- `post_max_size = 64M`


5. Activate your PHP 7.3 Version and turn off 7.1 version :

.. code-block:: shell

a2enmod php7.3

a2dismod php7.1

systemctl restart apache2

php -v


6. Update the Database

- Backup your Database :

.. code-block:: shell

mysqldump -u root -p --all-databases > all-db.sql

psw: "ENTER_YOUR_PASSWORD"

- Remove the old mariaDB db :

.. code-block:: shell

apt remove mariadb-server

- Adding a New apt source :

.. code-block:: shell

apt install software-properties-common -y

apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8

nano /etc/apt/sources.list.d/mariadb.list

- Add :

.. code-block:: shell

deb [arch=amd64,arm64,ppc64el]
http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.4/ubuntu bionic main
deb-src http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.4/ubuntu bionic main


- Update and Install the New Version of mariaDB :

.. code-block:: shell

apt update

apt install mariadb-server -y

exit



7. Installing Mautic 3

To start can execute the below commands :

.. code-block:: shell

sudo -u www-data php upgrade_v3.php

If you installed via Composer originally, you will need to use this trick :

.. code-block:: shell

mv composer.json composer.json2
sudo -u www-data php upgrade_v3.php

- If you get an error here just check if the ownership permissions are set properly

then run the upgrade again :

.. code-block:: shell

sudo -u www-data php upgrade_v3.php

8. Looking for new versions in 3.0 and then updating it 3.0+ (inside your Mautic folder) :

.. code-block:: shell

sudo -u www-data php bin/console mautic:update:find
sudo -u www-data php bin/console mautic:update:apply
sudo -u www-data php bin/console mautic:update:apply --finish

- set ownership and clear the cache :

.. code-block:: shell

chown -R www-data:www-data /path/to/your/mautic/
chmod -R 755 /path/to/your/mautic/
sudo -u www-data php bin/console cache:clear


9. Last Step:

Change your cron jobs from :

.. code-block:: shell

/app/console

to :

.. code-block:: shell

/bin/console

- If you would like to use the new Email Builder, go to plugins, click on install plugins and turn on the new builder.
You might need to log in and out before it's activated.

There you go finally upgraded to Mautic 3.0 !!!

If you are already on 3.x+ version and want to upgrade it to 4.x we got you covered check the below documentation.

To Update Mautic from 3.x to 4.x
*********************************

- Mautic 4 is the most stable release. It is already being used by many customers. When it was upgraded from Mautic 2 to Mautic 3, it had several issues with the database structure and even the file system. Here is a simple guide to go ahead!

Check failure on line 268 in docs/getting_started/how_to_update_mautic.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.Exclamation] Don't use exclamation points in text. Raw Output: {"message": "[Google.Exclamation] Don't use exclamation points in text.", "location": {"path": "docs/getting_started/how_to_update_mautic.rst", "range": {"start": {"line": 268, "column": 241}}}, "severity": "ERROR"}

You need to be at the root folder which is the /var/www/HTML/ currently where the Mautic code resides.

1. First step is to backup the file system, as said you need to be at /var/www/HTML/ for upgrading and for executing the commands given below:
the below command is used to backup your file system:

.. code-block:: shell

zip -r output_file.zip folder1


2. Backup your Database

.. code-block:: shell

mysqldump -u [user_name] -p [password] [mautic database_name] > [dumpfilename.sql]

you can then check if your files are created By running the below command :

.. code-block:: shell

ls -la

you should see the .sql and .zip files generated by running the above command.

3. Updating your current Environment
- Updating your PHP version from PHP7.3 to PHP7.4 and updating rest packages :

.. code-block:: shell

apt install mariadb-server apache2 libapache2-mod-php7.4 php7.4 unzip php7.4-xml php7.4-mysql php7.4-imap php7.4-zip php7.4-intl php7.4-curl php7.4-gd php7.4-mbstring php7.4-bcmath ntp -y

- Now lets change the Environment Variables :

.. code-block:: shell

nano /etc/php/7.4/apache2/php.ini

after running this command one should change the following variables values accordingly :

.. code-block:: shell

file_uploads = On
allow_url_fopen = On
short_open_tag = On
memory_limit = 256M
upload_max_filesize = 100M
max_execution_time = 300
post_max_size = 64M

.. note::

Regarding memory limit, you can be more generous and lift to 512M as well. Upload max file size is also up to you. I suggest a minimum of 20MB.

Check failure on line 321 in docs/getting_started/how_to_update_mautic.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.Units] Put a nonbreaking space between the number and the unit in '20MB'. Raw Output: {"message": "[Google.Units] Put a nonbreaking space between the number and the unit in '20MB'.", "location": {"path": "docs/getting_started/how_to_update_mautic.rst", "range": {"start": {"line": 321, "column": 143}}}, "severity": "ERROR"}

4. Now move to php4 officially, and restart our Apache :

.. code-block:: shell

a2enmod php7.4
a2dismod php7.3
systemctl restart apache2

and then check the current version of the php which is been used :

Check failure on line 331 in docs/getting_started/how_to_update_mautic.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'PHP' instead of 'php'. Raw Output: {"message": "[Vale.Terms] Use 'PHP' instead of 'php'.", "location": {"path": "docs/getting_started/how_to_update_mautic.rst", "range": {"start": {"line": 331, "column": 43}}}, "severity": "ERROR"}

.. code-block:: shell

php -v

.. note::
If you get something like this :
.. code-block:: shell

PHP 7.4.23 (cli) (built: Aug 26 2021 15:51:37) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.23, Copyright (c), by Zend Technologies

then we need to stop the cron jobs running in the background

.. code-block:: shell

sudo crontab -e

one fix is that you can add a # in front of the cron commands, like:

.. code-block:: shell

# * * * * * CRONJOBS HERE

5. Command Line Update !
- In order to create more tension we will do this in 2 steps. First we update to 3.3.4 and then to 4.0.1.

Let's look for a new version:

.. code-block:: shell

cd /path/to/your/mautic/
sudo -u www-data php bin/console mautic:update:find

after finding the latest version we need to apply it :

.. code-block:: shell

sudo -u www-data php bin/console mautic:update:apply

.. note::
Now we are prompted to apply finish. I would like to stop here for a moment. I know, that it is not the right way to use sudo when you are working here, but it is just simpler for folks if we don't go into permissions. But using a root user during updates can cause file creation with the wrong ownership. In order to avoid it we will make sure by almost every step that the files belong to the right user. So we hand over the files to the www-data user all the time (which is running our we server.)

Check failure on line 375 in docs/getting_started/how_to_update_mautic.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'sudo'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'sudo'?", "location": {"path": "docs/getting_started/how_to_update_mautic.rst", "range": {"start": {"line": 375, "column": 126}}}, "severity": "ERROR"}

- We do it by running this:

.. code-block:: shell

chown -R www-data:www-data /path/to/your/mautic/
chmod -R 755 /path/to/your/mautic/

- and now we can finish it by the following command :

.. code-block:: shell

sudo -u www-data php /path/to/your/mautic/bin/console
mautic:update:apply --finish

- If everything went well, we are on the 3.3.4 version, half way to 4.0.1. Let's look for a new version, and apply changes:

.. code-block:: shell

sudo -u www-data php /path/to/your/mautic/bin/console
mautic:update:find
sudo -u www-data php /path/to/your/mautic/bin/console
mautic:update:apply

.. note::
make sure that the file permissions is okay :

.. code-block:: shell

chown -R www-data:www-data /path/to/your/mautic/

chmod -R 755 /path/to/your/mautic/

And here comes the last step We are here ! Take a deep breath :

.. code-block:: shell

sudo -u www-data php /path/to/your/mautic/bin/console
mautic:update:apply --finish

Congrats you are on Mautic 4.x version give yourself a pat on your back !

.. note::

Need to make sure your templates are okay. Make sure,
that all of your email / landing page templates have the following config file
format especially the red line:

.. code-block:: shell

{
"name": "Template name",
"author": "Mautic team",
"authorUrl": "https://mautic.org",
"builder": ["grapesjsbuilder"],
"features": [
"email"
]
}
- If you are upgrading from a previous version, all your templates will have “builder”: “grapesjsbuilder”,

Check failure on line 435 in docs/getting_started/how_to_update_mautic.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'grapesjsbuilder'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'grapesjsbuilder'?", "location": {"path": "docs/getting_started/how_to_update_mautic.rst", "range": {"start": {"line": 435, "column": 90}}}, "severity": "ERROR"}
format, and you really need those brackets now.

Updating in the browser
***********************

Expand Down
Loading