Author Topic: How to Import database from old installation to a new one.  (Read 2215 times)

Offline naturessa

  • Newbie
  • *
  • Posts: 20
  • Karma: +2/-0
    • View Profile
How to Import database from old installation to a new one.
« on: October 11, 2015, 05:00:27 AM »
Just wondering is it anyway to restore store from old abantecart database.
I had a store a year ago, I have all files saved from server + SQL database.
Can I import this database somehow to a new store on a new domain?
I have config file from old store with old details.
The old domain is not exist. Prefix was ab_ in db before, now abc_.

Ive tried to import old database to a new one and to change prefix to old one ab_ , but this method doesn't work for me, shows critical errors.

I can not do a backup in old store, as its not live anymore. I have just files + database from it.
Thanks in advance.

Offline webdevmerc

  • Full Member
  • ***
  • Posts: 172
  • Karma: +32/-1
    • View Profile
Re: How to Import database from old installation to a new one.
« Reply #1 on: October 11, 2015, 09:36:45 AM »
I haven't tried it myself, but assuming you have access to PhpMyadmin, a way I would do this is install the new Abantecart version with sample data...export the data...Look at how the columns are setup.

Afterwards, get my old data from the old system, convert all the table data to what the new system wants, re-import.

This doesn't really install anything from the old set and is time consuming, but it's what I'd do since importing and having constant errors is a worst situation IMO than taking the painstaking time to clean up the old data.


Another method of course is to install your previous version of Abantecart.  Import all the data in that version, then slowly upgrade every version that was missed to the latest spec.  This might be easier and probably worth a look as well since as your system isn't live, if it doesn't work, it may save you a lot of time depending on how much conversion you'd have to do with the 1st method above.


Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 1807
  • Karma: +258/-11
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: How to Import database from old installation to a new one.
« Reply #2 on: October 11, 2015, 10:51:48 AM »
you can find table prefix in your system/config.php. see DB_PREFIX constant value.
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline naturessa

  • Newbie
  • *
  • Posts: 20
  • Karma: +2/-0
    • View Profile
Re: How to Import database from old installation to a new one.
« Reply #3 on: October 11, 2015, 11:45:32 AM »
I haven't tried it myself, but assuming you have access to PhpMyadmin, a way I would do this is install the new Abantecart version with sample data...export the data...Look at how the columns are setup.

Afterwards, get my old data from the old system, convert all the table data to what the new system wants, re-import.

This doesn't really install anything from the old set and is time consuming, but it's what I'd do since importing and having constant errors is a worst situation IMO than taking the painstaking time to clean up the old data.

Another method of course is to install your previous version of Abantecart.  Import all the data in that version, then slowly upgrade every version that was missed to the latest spec.  This might be easier and probably worth a look as well since as your system isn't live, if it doesn't work, it may save you a lot of time depending on how much conversion you'd have to do with the 1st method above.

Thank you, I like the second method you mention.
I would try it. I have PhpMyadmin, so I'll import all data with the right prefix from old database.

Where to find which version I had before? :)

Offline naturessa

  • Newbie
  • *
  • Posts: 20
  • Karma: +2/-0
    • View Profile
Re: How to Import database from old installation to a new one.
« Reply #4 on: October 11, 2015, 11:57:02 AM »
core/version.php

<?php
define('MASTER_VERSION', '1');
define('MINOR_VERSION', '1');
define('VERSION_BUILT', '9');

I guess it means I had version 1.1.9

Offline naturessa

  • Newbie
  • *
  • Posts: 20
  • Karma: +2/-0
    • View Profile
Re: How to Import database from old installation to a new one.
« Reply #5 on: October 11, 2015, 04:44:13 PM »
I've tried to install version 1.1.9 didn't work,
system/logs/error.txt  showed error:

Error: Unable to access or write to cache directory /var/www/username/data/www/sitename.com/store/system/cache/

Folder "cache" was 777 with right group and user-owner, accessible for writing for all users - 100%.

Tried many times with different folder permissions, didn't work.

Then I realized that I have a new php version, (had already this issue on my server before, Dmitriy fixed it)
and I changed in core/lib/cache.php

$cache_files = glob( DIR_CACHE. '*/*', GLOB_NOSORT);
if(!is_array($cache_files)

to

$cache_files = glob( DIR_CACHE. '*/*', GLOB_NOSORT);
if(!is_array($cache_files) || !is_writeable(DIR_CACHE))

And then installation completed successfully!

Imported all data from old sql, transferred pictures folders and storefront.
And now my old site is up again!

Had problem with additional languages, but also fixed them..

Thx webdevmerc for advises.
Thx abolabo for fixing "cache" problem

 

Powered by SMFPacks Social Login Mod