Importing backed up database with different name


#1

Hi, i backed up my database from my site i had on another hosting site a couple months ago and i’d like to import it to be used with my site on here but i keep getting an error that the database details are wrong. I don’t remember the details to my old database and i know the details to this one is different than the one that was used to back it up is there a way to change them to my new one so that i can use my back up on my new hosting site? I really don’t want to start over because i had a lot of work backed up i imported it and looked at the data and it’s all still there it’s just i don’t know how to make it work with my new database
details.


#2

So you can do this yourself pretty easily or I can do it for you if you want.
What you want to do is firstly make a copy of the database and keep it safe and now right click on the database and open it in notepad or if you have it notepad++ you will see a lot of garbled information no doubt database values etc but what you want to do is in the first page I would assume you’ll see the original database name you need to just really edit this out and replace it with your new database name you’ve created on our hosting and then save the file.
Now login to our hosting hit website manager then database manager and then manage on the created database or make a new one if you haven’t already and then PHP my admin once this is open hit import and then select the local SQL file you’ve just edited on your computer and hopefully it will import now as you’ve put the new database name in it.


#3

hey thanks for replying, i tried that i opened it on note++ and saw where it said database: and changed it to my new database name and it was still giving me an error i don’t know if this could mean anything but that database is from a different version of my site (2.53) i’m on 2.58 now i’ve had problems with this in the past so i think it could be a factor but i’m not sure. I reinstalled my entire site script right now because i didn’t back up my other database and couldn’t get the site working again so i’m running on a clean copy. I remember a while back i tried to do this so i reverted to the original version the database was created on and it worked for some reason


#4

Odd.
Can you upload the .sql file into the directory OUTSIDE your public_html folder and I’ll take a whack at it.


#5

yeah go head, i did it


#6

So I imported that database into a new database I created and it imported without any errors
It has 66 tables unlike your other database which has 75?


#7

But it also has 83 users where as your one has 0/1 I think?


#8

yeah that’s correct, though my current one has 1 user (me) i also checked my config file to see if my info was correct which is what the error im getting is telling me to do


#9

is there a way to just import the tables i need? if importing the entire database is being problematic and can’t be done for some reason i’m fine with just importing what i need


#10

So I imported the whole database you uploaded without error, where else did you get errors sorry?


#11

i will send you a screenshot of the error im getting. okay i just removed my current database and uploaded my backup which i’m trying to get to work (the one i uploaded for you) and whenever i got to my site domain i get this error something isn’t letting this database work with my site i don’t know if it could be because my other one has more tables as you discovered


#12

Hmm I enabled debugging and it suggests an error in the bootstrap.php file on line 154

Line 154 appears to be $get_static = $db->query(“SELECT page_url, page_title FROM static_pages WHERE page_in_footer = ‘1’”) or _error(SQL_ERROR);

I can’t see anything wrong but maybe I’m blind.

Try their Facebook for support?


#13

i would but they charge for support lol and my support is expired so for them to look at it and fix it would have to pay for more support, is there any way to get tables from this database and add them to my other one?


#14

Yeah of course, manage database, manage, phpMyAdmin, open up the database, select the ones required and export :smiley:


#15

thanks, I’ve managed to restore some tables and the data is there! the site is working again and the content is there should have done this from the start but wasn’t sure if it was an option or if it would work


closed #16

This topic was automatically closed after 42 hours. New replies are no longer allowed.