News:

Wondering if this will always be free?  See why free is better.

Main Menu

Moving database problems

Started by Psychoduck, January 30, 2014, 06:22:29 AM

Previous topic - Next topic

Psychoduck

Firstly may I say I don't dabble with database moves as I don't know what I'm doing.

I have 2 accounts with 2 domain names on the same server.

The main site was on domain1.info
domain2.co.uk empty site just domain name and hosting.

domain1.info has expired and I wanted to move the site to domain2.co.uk

1) First I exported the database from domain1.info and imported it into the new database on domain2.co.uk after installing SMF on domain2.co.uk. I had already uploaded all the html and forum files to domain2.co.uk before import/exporting database

All that showed on domain2.co.uk was the empty new SMF installation

So then I tried another way to do it

2) I backed up the database and html on domain1.info and downloaded it to my pc.
I then installed SMF on domain2.co.uk and made a database ready to upload the backup to.

I uploaded all files to the hosting for domain2.co.uk (html and forum files)
I restored from a back up on domain2.co.uk

All I have is the new SMF installed forum but none of the information from domain1.inf database.

I've run repair_settings.php tool and all the paths are correct.

I don't understand what I'm doing wrong.

The old database is still on the domain1.info site, but as the domain name has expired and I just have the empty hosting (I have a multi site hosting package - 5 accounts) can I still use the old database on domain1.info hosting and just change the url of the board on domain2.co.uk to point to it?

I can't get into the forum to change the url of the site on domain1.info because as the domain name has expired the site is no longer available (that particular domain name was with GoDaddy and they stopped access to the domain name the day it expired the other domain names I own are with other registrars)

I was working on this from 8pm last night til 2am this morning and now my heads spinning and I'm totally confused.

The hosting company tell me I can just use the old database where it is and use the domain2.co.uk as the main url for the site, but after faffing about with so much techy stuff I'm now totally at a loss.

Can someone advise please before I jump under the nearest bus LOL

Thanks


margarett

I'm sorry, I got a little bit lost in your description. But we sure don't want you jumping in front of any bus :P

So, first: YOU DON'T INSTALL SMF in the new domain.
You transfer the existing SMF database AND the existing SMF files from the old site to the new site.
Then you load repair_settings to the new site. Run it via browser and correct the paths. DO NOTE that the shown paths might seem correct because they exist on your server, but they are not valid for the new setup. Check them carefully.

Save. Txaram! :)
(Yes, it's really this simple)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Psychoduck

Thanks for your reply.

So do I need to now go to domain2.co.uk and delete the database and SMF. Then make a new database.

Then just run repair_settings.php file?

I think I tried that first last night and got errors that it couldnt find the database, but a bit confused now.LOL

I'll delete everything off domain2.co.uk and make a new database and then run the repair_settings.

Watch this space. ROFL

No buses due for another hour so I'm ok.

Psychoduck

So when you say transfer the old database to the new site, do I do it by export import or by back up and restore?

and you say
QuoteDO NOTE that the shown paths might seem correct because they exist on your server, but they are not valid for the new setup

How do I know if they're wrong if they look right? Confoosed

Sorry to be so dim.


margarett

It depends on your host and the tools it has available. Usually export and import via phpmyadmin. But you can also use cPanel to export and import it. Or some other alternatives.
How did you do it until now? You said that you already transferred the database...

As for the paths, you need to look at it. Imagine that your old domain points to
/home/users/as123456/public_html
And your new one points to
/home/users/as654321/public_html

If they are on the same server (which seems they are) both paths are correct, but you want to make sure you are using the second one. repair_settings should suggest you the adequate ones, just keep a close eye ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Psychoduck

Hi sorry to be a pain.

I exported via phpMyAdmin then went to the new database and imported it, the first time.

Thanks I'll do that now.

Thanks for tips on what to look for in the paths.

Will report back in a few mins.


Psychoduck

Exported from old database
Imported to new database

should I have zipped the sql file? I didn't.

and should I have checked the box make new database because I didnt I used the new database I'd made on domain2

uploaded repair_settings.php

went to url in browser and got this
QuoteWarning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/thechick/public_html/thecoop/repair_settings.php on line 336

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/thechick/public_html/thecoop/repair_settings.php on line 338

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/thechick/public_html/thecoop/repair_settings.php on line 353

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/thechick/public_html/thecoop/repair_settings.php on line 355

Notice: Undefined index: database_error in /home/thechick/public_html/thecoop/Sources/Subs-Db-mysql.php on line 569

Fatal error: Call to undefined function allowedto() in /home/thechick/public_html/thecoop/Sources/Subs-Db-mysql.php on line 570

margarett

That's not unheard...
Try to edit Settings.php directly (FTP to your computer, edit with Notepad++ and FTP back to the server)
Edit the main fields directly: database info and main path to Sources
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Psychoduck

Done that.

The database info was correct, but had to edit Directories/Files section as it still had the old account name and not the new one ie; /home/pekinout/public_html instead of home/thechick/public_html/

Reuploaded repair_settings.php

still got exactly the same errors as mentioned in previous post

margarett

Dang...
I'm sorry, I'm now driving so you need to wait for someone else to step in and help.

Final suggestion, search the forums for an older version of repair_settings. I seem to remember someone having this same issue...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Psychoduck

ok will do thanks.

It's so annoying. I have people emailing me because they cant acces the forum which doesn't help :(

If anyone else can help please do, the computer is so close to being thrown out of the window LOL

Psychoduck

None of the older versions I could find worked.

So still no board and same errors.

I have so much info on this board for members otherwise I'd just delete the damn thing and do a fresh forum but we need the info on there. :(

margarett

Just stopped for a coffee.

Later in the evening I can have a closer look, but until there I'm just in the phone.

If no other version works, then you should have something wrong with the files. Did you copy also the files to the new domain?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Psychoduck

Yes I backed up/downloaded/uploaded all the files from the old site to the new one.

I just can't understand why it won't work.

The domain1.info domain name was with GoDaddy, the domain2.co.uk is with Nameroute. My 5 site hosting package is with Hostroute and both domains were accounts within that package.

I wanted the domain1.info domain name to expire as I didn't want it anymore, and on the expiry date GoDaddy took the domain name off so I couldn't even get on there to do a proper forum backup to transfer it that way. I wasn't impressed.

I don't like GoDaddy to be honest. The owner is into 'Canned Hunting' in a big way, and pays thousands of dollars to shoot lions and wild animals bred for hunting in captivity which I don't agree with.

Nameroute usually give a few days after expirey so people can backup and move or renew domain names. But GoDaddy seem to be the exception.

See you later this evening

Thanks for helping.

Psychoduck

I removed everything from the public directory on domain1.co.uk and reuploaded the html site again just to make sure there were no corrupted or missing files.

Ditched the new database and made a new one.

Uploaded the sql file import/export then uploaded repair_settings.php

Ran that file and corrected all the paths.

Clicked save and got this

QuoteWarning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/thechick/public_html/thecoop/repair_settings.php on line 336

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/thechick/public_html/thecoop/repair_settings.php on line 338

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/thechick/public_html/thecoop/repair_settings.php on line 353

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/thechick/public_html/thecoop/repair_settings.php on line 355

Notice: Undefined index: database_error in /home/thechick/public_html/thecoop/Sources/Subs-Db-mysql.php on line 569

Fatal error: Call to undefined function allowedto() in /home/thechick/public_html/thecoop/Sources/Subs-Db-mysql.php on line 570

Exactly what I got before.

So went into the files Settings.php and the bak up file and one was fine the bak up one was the old domain info so changed it to the new info.

Retried the main url to the site and got this:

QuoteConnection Problems
Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.


What is so annoying is that when I bought the .co.uk domain 2 yrs ago (its due for renewal in March this year) I told the hosting company to make it the primary domain and park the .info one ontop so that when the .info expired the .co.uk would still be primary and the site would still be up and running with no problems. They didn't do that. Now I'm having all these problems and despite sending them support tickets they're just not helping or interested at all.

Sir Osis of Liver


Have you updated all of the database settings in Settings.php?



########## Database Info ##########
$db_server = '----------------------------------';
$db_name = '----------';
$db_user = '----------';
$db_passwd = '----------';
$db_prefix = 'smf_';
$db_persist = '0';
$db_error_send = 1;



Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Psychoduck

Yes done all those and in the settings backup file too

Psychoduck

Is there a way in phpMyAdmin can change the url for the site to domain2.co.uk ? Both domains are on the same server, and the hosting company have said I could do that, but I don't know how to do it.

::)

Sir Osis of Liver


The forum url is not in the database, it is where it is.  You get to the forum by linking to index.php in the forum root.  All other paths are relative to that.  You wouldn't be getting the database error if you weren't reaching it.  SMF can't find the database.  Copy the Database Info from Settings.php and pm it to me (don't post it). 

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Psychoduck


Advertisement: