Web based family history software

Question Problem importing local webtrees MySQL database

More
8 years 11 months ago #1 by dax29
Hi all

About 12 months ago I got assistance from the forum with setting up webtrees on a local server using Xampp.

Unfortunately a couple of weeks ago my PC died and I needed to purchase a new one which I have done. I'm now in the process of putting a local copy of webtrees on my PC but have run into a problem I have no idea how to fix.

So to date, I have installed XAMPP, downloaded and installed webtrees 1.6.2 into C:\xampp\htdocs\webtrees. I have then set up my data in webtrees by importing my gedcom file.

Next I have done a SQL dump using phpMyAdmin, then have imported the sql file into my local webtrees MySQL database.
and then my problem occurs, I get the following error:

Error
SQL query:

CREATE TABLE IF NOT EXISTS `wt_gedcom` (
`gedcom_id` int(11) NOT NULL,
`gedcom_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`sort_order` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
MySQL said: Documentation

#1215 - Cannot add foreign key constraint

As I have no idea where to go from here, I would really appreciate any assistance with this issue. Thanks in advance

Frank (Dax) Kuilboer
Broadwater Qld Australia
familytree.kuilboer.id.au

Please Log in or Create an account to join the conversation.

  • fisharebest
  • Away
  • Administrator
  • Administrator
More
8 years 11 months ago #2 by fisharebest
Replied by fisharebest on topic Problem importing local webtrees MySQL database

Next I have done a SQL dump using phpMyAdmin


Do the export again.
This time, tick the box "Disable foreign key checks"

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago #3 by dax29
Hi Greg
Thanks for the quick response.

I did have the "Disable foreign key checks" ticked as I have been following the instructions given to me last year by Jackie (see attached), by did it again anyway and still got the same error
I have also attached screendump of the setting I use for the export

Cheers

Dax

Frank (Dax) Kuilboer
Broadwater Qld Australia
familytree.kuilboer.id.au
Attachments:

Please Log in or Create an account to join the conversation.

  • fisharebest
  • Away
  • Administrator
  • Administrator
More
8 years 11 months ago #4 by fisharebest
Replied by fisharebest on topic Problem importing local webtrees MySQL database
Are you importing into an empty database? Try deleting the existing tables first.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago #5 by dax29
Sorry Greg not sure what you mean?

I just deleted webtrees from C:\xampp\htdocs and tehn reinstalled it and created my familytree database but didn't import the gedcom file....Is that what you mean?
I then tried it again and still got the same error

Also when you say delete the existing tables, which do you mean?

Cheers

Dax

Frank (Dax) Kuilboer
Broadwater Qld Australia
familytree.kuilboer.id.au

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago - 8 years 11 months ago #6 by Jackie

dax29 wrote:
1 - So to date, I have installed XAMPP, downloaded and installed webtrees 1.6.2 into C:\xampp\htdocs\webtrees.
2 - I have then set up my data in webtrees by importing my gedcom file.
3 - Next I have done a SQL dump using phpMyAdmin,
4 - then have imported the sql file into my local webtrees MySQL database.

and then my problem occurs, I get the following error:..


Hello Dax,

Wrong steps and actions.
1- do your number 3
2- do your number 4 in a new database (created in MySQL - using phpMyAdmin)
3- do your number 1, telling webtrees the name of the new database at that step of the installation process: wiki.webtrees.net/en/Installation#Database_configuration
4- don't import any .ged file because all is already in the MySQL database.

EDIT: just remember that you need to import your SQL dump in an empty MySQL database.
Last edit: 8 years 11 months ago by Jackie.

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago #7 by Jackie
Hi,

How to create a new database in MySQL?

Attachments:

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago #8 by dax29
Hi Jackie

Thanks for your feedback and instructions however I am a little confused with the steps.

You say:
The first thing I should do is a SQL dump using phpMyAdmin - I presume this is the export function but what am I exporting from as I haven't installed anything yet except XAMPP?

I would have thought I should have installed webtrees first or am I completely off the track?

So sorry to be asking all these questions
Cheers
Dax

Frank (Dax) Kuilboer
Broadwater Qld Australia
familytree.kuilboer.id.au

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago #9 by Jackie
Hello Dax,

When you run webtrees installation, it creates a new MySQL database and new tables in that database unless you tell webtrees that a MySQL database already exists and it has to use that one.

At first, you tried to import a SQL dump in a MySQL database which already had all webtrees tables that you have just created by the installation process. That is the reason why Greg said to delete existing tables (MySQL webtrees tables). Then, re-import your SQL dump.

The key word here is "Import your SQL dump in an empty MySQL database"

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago #10 by Jackie
Step 1 : Export a SQL dump from your live site (online).

You already have done that step.

Step 2 : in your XAMPP phpMyAdmin, create a new MySQL database. (see the previous attachment "How to")

Step 3 : in that new MySQL database, import your SQL dump

Step 4 : run webtrees installation process, at the step "Database configuration" tell webtrees the name of your MySQL database that you have just created.

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago #11 by Jackie

I would have thought I should have installed webtrees first or am I completely off the track?


Yes you are. ;-)

If you install webtrees first, it creates a new MySQL database and new tables in it.

Then, if you import a .ged file in that new webtrees installation, what do you think happens in the new MySQL database created by webtrees?
All MySQL tables will be filled in by the data contained in your .ged file. Therefore, your MySQL database is no more empty.

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago #12 by dax29
Jackie Your a champion!!!!!

All fixed, where my problem was, was that I was I wasn't exporting my dump file from my live site?????? How dumb was that!!!
As soon as you mentioned exporting from my live site it all fell into place.

Thank you soooo much for your help and patience, hopefully I won't need to go through this process again.

Cheers

Dax

Frank (Dax) Kuilboer
Broadwater Qld Australia
familytree.kuilboer.id.au

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago #13 by Jackie

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum
}