HowTo convert a database from utf8 to utf8mb4 » History » Version 1

C S, 2021-03-19 12:59
Simple instructions for converting the character set

1 1 C S
h1. HowTo convert a database from utf8 to utf8mb4
2 1 C S
3 1 C S
First things you have to do is like an upgrade
4 1 C S
5 1 C S
h2. Step 1 - Check requirements
6 1 C S
7 1 C S
The first step to upgrading Redmine is to check that you meet the [[RedmineInstall#Requirements|requirements]] for the version you're about to use or install.
8 1 C S
9 1 C S
h2. Step 2 - Backup
10 1 C S
11 1 C S
It is recommended that you backup your database and file uploads. Most upgrades are safe but it never hurts to have a backup just in case.
12 1 C S
13 1 C S
To understand how to back up your Redmine, please read [[RedmineBackupRestore|Backing up and restoring Redmine]].
14 1 C S
15 1 C S
h2. Step 3 - Convert
16 1 C S
17 1 C S
Actually, the conversion is already done with a single command line
18 1 C S
19 1 C S
<pre>
20 1 C S
<code class="sql">
21 1 C S
ALTER DATABASE redmine DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
22 1 C S
</code>
23 1 C S
</pre>
24 1 C S
25 1 C S
If you use an assistant such as _phpMyAdmin_, you can simply select the database there and select the item _Collation_ under the _Operations_ tab.
26 1 C S
27 1 C S
The conversion of the character set is now complete.