Title: Database errors during writing
Last modified: August 24, 2016

---

# Database errors during writing

 *  Resolved [alex.mqt](https://wordpress.org/support/users/alexmqt/)
 * (@alexmqt)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/database-errors-during-writing/)
 * Hi,
 * I’ve installed Duplicator on my local website to copy it to my server.
    After,
   when I want to install it on the server, there are hundreds of errors of writing
   in the database. And when I want to access to the website, it needs a WordPress
   installation again (impossible to do because of database errors at the end of
   it). However, WordPress seems to be copied to the server as there are the folders
   of wp in it.
 * I’ve tried with Duplicator version 0.5.18 and 0.5.19 (development), with WordPress(
   4.2.2) installed on the server and without. Always the same errors.
 * Thanks in advance for your help!
 * [https://wordpress.org/plugins/duplicator/](https://wordpress.org/plugins/duplicator/)

Viewing 15 replies - 16 through 30 (of 38 total)

[←](https://wordpress.org/support/topic/database-errors-during-writing/?output_format=md)
[1](https://wordpress.org/support/topic/database-errors-during-writing/?output_format=md)
2 [3](https://wordpress.org/support/topic/database-errors-during-writing/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/database-errors-during-writing/page/3/?output_format=md)

 *  [Cory Lamle](https://wordpress.org/support/users/corylamleorg/)
 * (@corylamleorg)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/database-errors-during-writing/page/2/#post-6129477)
 * Hey bkjproductions,
 * We are doing some research on this one to target the best approach for how to
   properly output the data. If you would like to help beta test it, just submit
   a [support ticket](https://lifeinthegrid.com/support) with a reference to this
   thread and I’ll loop you in on the changes, when we get it in the queue…
 * Cheers~
 *  [lpuga](https://wordpress.org/support/users/lpuga/)
 * (@lpuga)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/database-errors-during-writing/page/2/#post-6129479)
 * Hello,
 * This is my first time transferring a site. I too am getting deployment errors
   that look like this:
 * > **ERROR** database error write ‘Unknown collation: ‘utf8mb4_unicode_ci” – [
   > sql=
   >  CREATE TABLE `wp_commentmeta`
 * I see that I am supposed to edit the character set, but in which file(s)? When
   I look at the archive that I created, its wpconfig reads:
 * >  /** Database Charset to use in creating database tables. */
   >  define(‘DB_CHARSET’,‘
   > utf8’);
   > /** The Database Collate type. Don’t change this if in doubt. */
   >  define(‘DB_COLLATE’,”);
 * Is there a different file(s) I need to edit? Do I it prior to running the duplicator
   or once the site is on my new server?
 * Any help would be greatly appreciated. Thank you in advance.
 *  [lpuga](https://wordpress.org/support/users/lpuga/)
 * (@lpuga)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/database-errors-during-writing/page/2/#post-6129481)
 * Disregard. I’ve figured it out.
 *  [Cory Lamle](https://wordpress.org/support/users/corylamleorg/)
 * (@corylamleorg)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/database-errors-during-writing/page/2/#post-6129482)
 * Hey lpuga,
 * Thats good to hear! If you can post your steps it may benefit others…
 * Cheers~
 *  [dugdesigns](https://wordpress.org/support/users/dugdesigns/)
 * (@dugdesigns)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/database-errors-during-writing/page/2/#post-6129483)
 * I had this same issue.
 * 6000 or so errors of this:
 * **ERROR** database error write ‘Unknown collation: ‘utf8mb4_unicode_ci” – [sql
   =
    CREATE TABLE wp_commentmeta
 * alex.mqt post was what worked for me. Thanks for posting Alex!
 * To elaborate. I unzipped the zipped file that Duplicator creates. Found database.
   sql, opened with a text editor, did a find and replace.
 * Find: utf8mb4 replace with: utf8
 * Saved file and rezipped. Deleted all files on server, re-uploaded and ran install
   again. That produced no errors on install.
 * Please note though, I still haven’t successful made this work. Just started another
   discussion about the file unzipping, but not pulling the files out of the unzipped
   file. Thread link below.
    ([https://wordpress.org/support/topic/unzips-but-stays-in-unzipped-folder](https://wordpress.org/support/topic/unzips-but-stays-in-unzipped-folder))
 *  [NDA01](https://wordpress.org/support/users/nda01/)
 * (@nda01)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/database-errors-during-writing/page/2/#post-6129484)
 * I also have this character encoding problem after migrating a site. There are
   random question marks within diamonds instead of spaces. Unfortunately, I only
   know enough to get myself into trouble if I start editing databases. Bluehost
   sent me instructions on converting a MySQL database to UTF-8, but it begins sounding
   Greek to me. I may have higher confidence entering all the text again manually
   in WordPress since it is still new site.
 * It would surely be nice to have an easy fix within Duplicator. The migration 
   went smoothly, for which I’m grateful. But the character encoding problem took
   me a couple of hours to search and identify. Now I need to do the conversion 
   while keeping my fingers crossed that I don’t screw something up.
 *  [dugdesigns](https://wordpress.org/support/users/dugdesigns/)
 * (@dugdesigns)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/database-errors-during-writing/page/2/#post-6129485)
 * NDA01, I had that same issue with the question marks.
 * I believe it had something to do with the import of the database and the UTF8
   code. Keep in mind I’ve tried so many things it’s hard to keep track, but I finally
   have a complete duplicate of my website up and running.
 * For my issue, I believe this fixed it, I exported the database again (working
   local) and selected MYSQL40 in the Database Compatibility Mode and checked Add
   DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT.
 * I then imported it (on web server) and all the question marks and content was
   fixed.
 * If you try this, be sure to export your current database as a backup so should
   something go wrong you can just revert back to that.
 * Hope that helps.
 *  [NDA01](https://wordpress.org/support/users/nda01/)
 * (@nda01)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/database-errors-during-writing/page/2/#post-6129486)
 * Thanks dugdesigns. Another option Bluehost gave was to force UTF-8 through the.
   htaccess file. This tells any browser visiting the site to use UTF8 instead of
   UTF8.mb4.
 * Open the .htaccess file and add the following code:
    `AddCharset UTF-8 .html .
   htm .php`
 * Can anyone advise whether there are drawbacks doing this?
 *  [ctomlin](https://wordpress.org/support/users/ctomlin/)
 * (@ctomlin)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/database-errors-during-writing/page/2/#post-6129487)
 * Sorry all, but I am trying this and it’s just not working for me. I keep getting
   the same error after doing the steps that dugdesigns spelled out.
 * Here’s the error, it occurs on Step 2 of the Duplicator installer process…
 * “Notice: Undefined variable: all_tables in C:\Users\CT\Documents\Websites\www.
   arealpsychic.dev\installer.php on line 406”
 * Screenshot = [http://screencast.com/t/gzsxQc61h4I](http://screencast.com/t/gzsxQc61h4I)
 * Any help in resolving this error would be REALLY appreciated! Thanks!
 *  [Cory Lamle](https://wordpress.org/support/users/corylamleorg/)
 * (@corylamleorg)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/database-errors-during-writing/page/2/#post-6129489)
 * Hey Ctomlin,
 * check the database.sql file after its extracted from the archive, does it have
   any data in it? It seem like the file might be empty based on that error…
 *  [Hugo1177](https://wordpress.org/support/users/hugo1177/)
 * (@hugo1177)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/database-errors-during-writing/page/2/#post-6129500)
 * That error
 *     ```
       **ERROR** database error write 'Unknown collation: 'utf8mb4_unicode_ci'' - [sql=
       CREATE TABLE <code>wp_commentmeta</code> (
         <code>meta_id</code> bigint(20) unsigned NOT NULL A...]
       ```
   
 * is still there.
 * Will it be fixed some day?
 *  [Hugo1177](https://wordpress.org/support/users/hugo1177/)
 * (@hugo1177)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/database-errors-during-writing/page/2/#post-6129501)
 * I found a solution:
 * In the installer.php go to advancd options and replace
    utf8 with utf8mb4 and
   utf8_unicode_ciand with utf8mb4_unicode_ci
 *  [Cory Lamle](https://wordpress.org/support/users/corylamleorg/)
 * (@corylamleorg)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/database-errors-during-writing/page/2/#post-6129502)
 * Sweet! Thanks for the update Hugo…
 *  [willbe](https://wordpress.org/support/users/willbe/)
 * (@willbe)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/database-errors-during-writing/page/2/#post-6129503)
 * I replaced in the advanced options utf8mb4_unicode_ci but still gives me the 
   error:
    Notice: Undefined variable : ALL_TABLES in /Applications/XAMPP/xamppfiles/
   htdocs/duplicator/installer.php online 406
 * anyone can help me?
 *  [Cory Lamle](https://wordpress.org/support/users/corylamleorg/)
 * (@corylamleorg)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/database-errors-during-writing/page/2/#post-6129504)
 * Hey Willbe,
 * If you want to submit a ticket I can have a look at your package file to see 
   why it may be having this issue…
 * Thxs

Viewing 15 replies - 16 through 30 (of 38 total)

[←](https://wordpress.org/support/topic/database-errors-during-writing/?output_format=md)
[1](https://wordpress.org/support/topic/database-errors-during-writing/?output_format=md)
2 [3](https://wordpress.org/support/topic/database-errors-during-writing/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/database-errors-during-writing/page/3/?output_format=md)

The topic ‘Database errors during writing’ is closed to new replies.

 * ![](https://ps.w.org/duplicator/assets/icon-256x256.png?rev=2906985)
 * [Duplicator - Backups & Migration Plugin - Cloud Backups, Scheduled Backups, & More](https://wordpress.org/plugins/duplicator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/duplicator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/duplicator/)
 * [Active Topics](https://wordpress.org/support/plugin/duplicator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/duplicator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/duplicator/reviews/)

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [errors](https://wordpress.org/support/topic-tag/errors/)
 * [server](https://wordpress.org/support/topic-tag/server/)
 * [writing](https://wordpress.org/support/topic-tag/writing/)

 * 38 replies
 * 16 participants
 * Last reply from: [Cory Lamle](https://wordpress.org/support/users/corylamleorg/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/database-errors-during-writing/page/3/#post-6129517)
 * Status: resolved