I have a shopping cart and am trying to do a fresh install of it while preserving the existing data in the database. So I installed the new version of the cart in a separate folder with a new database. I then followed the instructions below:
- select the new database
- go to tab “structure”
- check all tables
- “with selected” -> empty
Rather that exporting and importing it could be worth a try to copy the old data into the new database
(it assumes they run on the same server)
- select the old database
- go to tab “operations”
- copy database to -> “livecart_new” (name of the new database you have already created)
- select “data only”
It should now copy the old data into the new database.
- select “data only”
I was able to successfully empty all the tables of the fresh install, but ran into this when I tried to copy the data from the old database into the new empty database:
[B]Error
SQL query: DocumentationEdit
INSERT INTO robertco_LC131
.AccessControlAssociation
SELECT *
FROM robertco_LC
.AccessControlAssociation
MySQL said: Documentation
#1452 - Cannot add or update a child row: a foreign key constraint fails (robertco_LC131/AccessControlAssociation
, CONSTRAINT UserGroup_AccessControlAssociation
FOREIGN KEY (userGroupID
) REFERENCES UserGroup
(ID
) ON DELETE CASCADE ON UPDATE CASCADE) [/B]
Can anyone assist me with this error? How come I simply can’t copy data from old to new?