Search code examples
wampdatabase-migrationwampserver

how to migrate a website database using wamp


this is my first time dealing with website and database I actually found out about migration while googling how-to. It's a graduation project and the website was made by someone whos not available right now and we rushing to add some requested stuff to the website.

this is how the website looks like

enter image description here

when I try to log in i see this error SQLSTATE[HY000] [1049] Unknown database 'dbscs' (SQL: select * from userswhereemail = root limit 1)

enter image description here

all I did is unzip the website WinRAR in www folder in wamp. I did not run any kind of migration

the website navigates to log in and Register but when registering or login in this error shows up. I think I'm missing the migrating I don't know. please help


Solution

  • Brief explanation:

    1. Log into the live site's phpMyAdmin utility.
    2. Export a SQL script (gzip compressed to conserve space) of your live database.
    3. Log into the localhost's phpMyAdmin. Which is found by clicking the WAMP icon in your system tray and selecting phpMyAdmin. Looks like you may already have that open.
    4. Create a database there if you do not already have one prepared for this environment. I name it the same as the live version to keep it simple.
    5. Select the Import tab and choose the file you downloaded from step 2.

    This will import a copy of the live database into your local dev environment into a database you created. If you named it 'dbscs' then your error of "Unknown database" should resolve. However you may need to update the connection string in local application files to point to the database you created so that your local environment can pull in the data. I had to do this for a WordPress website that I wanted to develop locally.