Rrestore db from server to localhost (XAMPP)

Hello,

I’m trying to install Dolibarr on my localhost (XAMPP) from a backup file of a Dolibarr that is live on a ubuntu server. I followed the instructions of wiki.dolibarr but when I run the SQL command I get the following error

ERROR 1005 (HY000) at line 25: Can’t create table dolibarr.llx_accounting_account (errno: 150 “Foreign key constraint is incorrectly formed”)

I suppose that is a database compatibility issue. Does anyone have t suggest something?

Localhost :
windows 10
XAMPP
PHP 7.3.11
MySQL 15.1 Distrib 10.4.8-MariaDB

Server :
Ubuntu 18.04
PHP 7.2.24
MySQL 14.14

Thank you in advance.

Try to use PHPMYSQL,
import database, without checking “Foreign Key constraint”
then try to run Dolibarr.

Hello and thanks for the response,

I tried to import the backup from phpmyadmin and unchecked the “Foreign Key constraint” but the same error occurred. :confused:

Questions: The backup file must be created from “MySQL Backup php” option, in order to follow this step?

I DID !
I just delete the database and created a new one. After that, I imported the SQL dump and everything is okay now!

Hi @lomasi,
Almost 3.5 years later, but your reply has helped me today. I made a minor tweak, instead of deleting the entire database, I just dropped all the tables. I have installed Dolibarr via One-Click install and hence it auto creates a database with complex names. Deleting the DB and recreating a new one would have been a painful task hence this shortcut based on your solution! Thanks!!