Jump to content

New install of Prestashop with existing DB?


Recommended Posts

Hi,

it looks as though my site is now not going to be recoverable from a problem I had yesterday. I have the DB completely intact. Is it possible to install PrestaShop and use the existing database which I set up (and product photos) without having to completely blow everything away first?

cheers,

Wittner

Link to comment
Share on other sites

Ok. I have just started the install process and there is no option to select the previous database. It looks as if PrestaShop does not allow me to install with an existing database. I get the following error message:

"a prestashop database already exists please delete it or change the prefix."

Does this mean it is actually not possible to install PS with an existing DB?

cheers,

Wittner

Link to comment
Share on other sites

Does this mean it is actually not possible to install PS with an existing DB?


An existing DB yes, but it musn't already contain tables with the same name that the installer will create. So if you already installed PS in this DB, you'll have to use another database OR delete the tables in this database OR give another prefix to the tables to create.
Link to comment
Share on other sites

Thanks Patric for your help. I've decided to go with a re-install. I have all the photos for my products locally so it'll be a bit of a pain but not so bad. the store is not open for the public yet anyhow (and it's my own store, not for a client!) so at least I'll get to know a little more about how PrestaShop works!

;-)


cheers,


Wittner

Link to comment
Share on other sites

You can use a fresh install of PrestaShop, let it create the DB, and then do a 'restore' function from the old DB to the new DB.

I use MySQL 5.X and the MySQL gui tools with it. I can reinstall a PS and overwrite the new database from my old database inside of 15 minutes start to finish.

What Db are you using?

Link to comment
Share on other sites

You need to keep these files from your old installation :
-your database
-setting.inc.php ( inside config directory )
-img directory ( I assume you will use the same version for your new one )
-any extra personal modules you have which is not an original one, inside modules directory.
-any personal themes you have which is not an original one, inside themes directory.

Step needed :
1. Extract prestashop installer into a directory you want.
2. Create a new database and restore your backup. ( you can use the same name or different one )
3. Copy that setting.inc.php into config directory.
4. I assume you use the same version, just replace the entire img directory with your img directory.
5. Copy your personal modules into modules directory. ( if any... )
6. Copy your personal themes into themes directory. ( if any... )
7. Go to your setting.inc.php. Open it.
8. These lines need attention :
define('_DB_SERVER_', ''); ( usually local host )
If you use other db server, than change it.
If your new and old are the same, leave it alone.

define('_DB_TYPE_', '');
Database engine used for your prestashop. I'm using MySQL here...
If your new one use the same engine as old one, leave it alone.

define('_DB_NAME_', '');
If you use different db name, change it.

define('_DB_USER_', '');
If you haven't define your server db user name, leave it with root.

define('_DB_PASSWD_', 'If you haven't define your server db password, leave it blank.

define('_DB_PREFIX_', '');
( take a look at your tables, what is the same word used by every tables, for example :
ps_trycustomer
ps_trycategory
ps_tryproduct
ps_try here is the prefix. )

define('__PS_BASE_URI__', '');
Example : your old url for prestashop is www.myshop.com, it will be written as /www.myshop.com/
Replace it with your new url. ( or whatever new directory you will use )

define('_THEME_NAME_', '');
This line only need attention if you use personal themes. If you don't leave it alone. If you use other, your current setting.inc.php should already filled with you theme name.
If you forget to backup your themes, filled it with prestashop. ( this is the original theme )

Sorry for my broken english, hope it help.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...