Transfering db

Ask questions about dedicated servers here and we and other users will do our best to answer them. Please also refer to the self-help section for tutorials and answers to the most commonly asked questions.
Post Reply
justin2234
A regular
A regular
Posts: 40
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Sat Oct 31, 2015 10:29 am

Transfering db

Post by justin2234 »

So i bought a managed vds + webhosting and i set up my website forums/bans/etc on there with the databases on there as well. Also i have a domain connected to nfo nameservers through there.
I have also a unmanaged vds thats set up with mysql and phpmyadmin.

So what i did is export the sourcebans database from the managed vds webhosting and imported it into my newly created db for my unmanaged vds. This is where im stuck because if i change the hostname/user/pass/dbname on the ftp for the webhosting on the managed vds, then i get errors. I want to be able to just transfer the database to the unmanaged vds but still keep my ftp and domain name intact on my managed vds webhosting. Any way to do this?
Image
User avatar
rlm850
This is my homepage
This is my homepage
Posts: 141
Joined: Thu Dec 10, 2009 12:17 am
Location: Staten Island, NY
Contact:

Re: Transfering db

Post by rlm850 »

If I'm understanding correctly, what you're trying to do is something like this..

Two packages:
web
unmanaged vds

You exported your DB contents from the web package, and imported into the DB on the unmanaged vds.
You are receiving errors -- stating that the database login failed/miscommunicated/is incorrect.

If this is the case, and you are running some sort of web page on either machine, you need to allow the database to communicate externally.

If the database is still on the "web" package, just visit the Databases tab and tick the "Allow external connections" box.
If the database is on the "unmanaged" package, make sure that the application rendering the page on "web" has the correct settings in the relative config file.

The application on "web" may currently have the DB Host set as "localhost" in said file. You need to change this to communicate with the remote server (unmanaged vds), which would be the IP address MySQL is running on (otherwise the default/only IP).

When this is done, to still utilize the same domain name, you would go into your "Domains" tab for the web package, and set up a redirect to your unmanaged vds.

https://www.nfoservers.com/control/domains.pl
You should see a table representing subdomain, type, and target.

"Subdomain" is what you want to name it, "type", in this case will be A. "Target" is the IP address.

Lets say your unmanaged vds IP is 69.216.212.42
Subdomain: sourcebans
Type: A
Target: 69.216.212.42

You will now be able to access that site from sourcebans.yourdomain.url
justin2234
A regular
A regular
Posts: 40
Joined: Sat Oct 31, 2015 10:29 am

Re: Transfering db

Post by justin2234 »

But for this wouldnt i need to add the ftp files from the web plan to the unmanaged vds for it to show up as sourcebans.domainname.com?
Image
justin2234
A regular
A regular
Posts: 40
Joined: Sat Oct 31, 2015 10:29 am

Re: Transfering db

Post by justin2234 »

So like,

The sourcebans database and ftp files are on web plan and i moved the database to the umanaged vds phpmyadmin.

So now all i have to do is go to web and click domains for example is like set it like this?
69.216.212.42/sourcebans
Subdomain: sourcebans
Type: A
Target: 69.216.212.42

and move over the sourcebans ftp on web to the unmanaged vds? and then of course edit the config.php on the unmanaged vds?
which would then show the panel on sourcebans.yourdomain.com.
is this correct? (if what i just said is correct then im lost as to how would i upload the files to the unmanaged vds so it would show up sourcebans as the url For Example: 69.216.212.42/sourcebans)
Image
User avatar
rlm850
This is my homepage
This is my homepage
Posts: 141
Joined: Thu Dec 10, 2009 12:17 am
Location: Staten Island, NY
Contact:

Re: Transfering db

Post by rlm850 »

justin2234 wrote:But for this wouldnt i need to add the ftp files from the web plan to the unmanaged vds for it to show up as sourcebans.domainname.com?
Nope! As long as you have the DNS updated to reflect the changes you wish, it can be hosted remotely.
justin2234 wrote:So like,
The sourcebans database and ftp files are on web plan and i moved the database to the umanaged vds phpmyadmin.
So now all i have to do is go to web and click domains for example is like set it like this?
This is correct, but remember -- you don't have to do it this way. You could just transfer everything over if you wanted to.
justin2234 wrote: 69.216.212.42/sourcebans
Subdomain: sourcebans
Type: A
Target: 69.216.212.42
As far as that bold line goes, it all depends on the apache directory you have sourcebans in on your VDS.

If you have it directly in a /public_html/ tree, it ends up being 69.216.212.42/index.php?p=home
If you have it inside a directory within a /public_html/ tree, such as "sourcebans", it becomes 69.216.212.42/sourcebans/index.php?p=home

It is up to you on how you want it to be seen.
justin2234 wrote: and move over the sourcebans ftp on web to the unmanaged vds? and then of course edit the config.php on the unmanaged vds?
which would then show the panel on sourcebans.yourdomain.com.
is this correct? (if what i just said is correct then im lost as to how would i upload the files to the unmanaged vds so it would show up sourcebans as the url For Example: 69.216.212.42/sourcebans)
Yes, that is correct. But as far as FTP goes - there is none installed by default on an unmanaged VDS. You will need to install an FTP server, such as FileZilla Server (very easy to setup [windows]). However if you do have Windows, you do not really need an FTP server so long as you have RDP (remote desktop). You are able to view everything there -- why spend more resources!

If you move the database, you will need to update the config, yes.

tl;dr

If you want, you can follow these. I believe you are trying to achieve exactly this.
1) Sourcebans database -export- from website, -import- to VDS
2) Visit sourcebans config on web end (if still hosting files there) and update the DB fields to reflect the ones on your VDS
e.g. DB Host: 69.216.212.42 DB User: newuser DB Pass: newpass DB Table: (should still be the same)
3) If the files are still on your website, and all you made was a DB change, sourcebans is still visible from the original URL.

If you are moving everything, however:
1) Sourcebans database -export- from website, -import- to VDS, transferred files to VDS
2) Visit sourcebans config on now the VDS end and update the DB fields (as shown above)
3) Now that the files are here, if you visit your VDS IP such as http://69.216.212.42, you will either be presented with a directory tree, or your sourcebans installation.

If you want to change your DNS setting to reflect this, you can do so as I had said above:
Subdomain: sourcebans
Type: A
Target: 69.216.212.42
Your sourcebans page ends up being http://sourcebans.yourdomain.com/index.php?p=home (or the directory it's in)

Ya get me now? :P
justin2234
A regular
A regular
Posts: 40
Joined: Sat Oct 31, 2015 10:29 am

Re: Transfering db

Post by justin2234 »

I tried the first one you said about just changing the database and i got this on the webpanel for sourcebans which you said this
"If you want, you can follow these. I believe you are trying to achieve exactly this.
1) Sourcebans database -export- from website, -import- to VDS
2) Visit sourcebans config on web end (if still hosting files there) and update the DB fields to reflect the ones on your VDS
e.g. DB Host: 69.216.212.42 DB User: newuser DB Pass: newpass DB Table: (should still be the same)
3) If the files are still on your website, and all you made was a DB change, sourcebans is still visible from the original URL."

and this was my outcome -------
Warning: mysqli_real_connect(): (HY000/2002): Connection refused in /usr/www/xxx/public/bans/includes/adodb/drivers/adodb-mysqli.inc.php on line 117

Fatal error: mysqli error: [2002: Connection refused] in CONNECT(xx.xx.xxx[<- my ip went here]), '****', '****', xxx_globalbans) in /usr/www/xxx/public/bans/includes/adodb/adodb-errorhandler.inc.php on line 77
Image
justin2234
A regular
A regular
Posts: 40
Joined: Sat Oct 31, 2015 10:29 am

Re: Transfering db

Post by justin2234 »

is there any way i can contact you on steam or skype so you can help me out on this? Please
Image
justin2234
A regular
A regular
Posts: 40
Joined: Sat Oct 31, 2015 10:29 am

Re: Transfering db

Post by justin2234 »

Ok so i tried your second option--------------
If you are moving everything, however:
1) Sourcebans database -export- from website, -import- to VDS, transferred files to VDS
2) Visit sourcebans config on now the VDS end and update the DB fields (as shown above)
3) Now that the files are here, if you visit your VDS IP such as http://69.216.212.42, you will either be presented with a directory tree, or your sourcebans installation.
If you want to change your DNS setting to reflect this, you can do so as I had said above:
Subdomain: sourcebans
Type: A
Target: 69.216.212.42
Your sourcebans page ends up being http://sourcebans.yourdomain.com/index.php?p=home (or the directory it's in)
My Process in detail
So yes i exported all ftp/db from webhosting to vds. The sourcebans is now installed on the vds main ip http://67.432.332.46 (for example) i did not add a subdomain to the vds.
Now i went to the config for the vds sourcebans files. And i changed host to: 67.432.332.46 and the user/pass to phpmyadmin user/pass and also the db name i changed to correct name. Now heres the wierd part, this is my errors when i do that and its all set up correctly with the type "A" pointing at the correct domain, which is sourcebans.domainname.com: Warning: mysqli_real_connect(): (HY000/2003): Can't connect to MySQL server on 'xx.xxx.xxx.xx' (111) in /var/www/html/includes/adodb/drivers/adodb-mysqli.inc.php on line 117

Fatal error: mysqli error: [2003: Can't connect to MySQL server on 'xx.xxx.xxx.xx' (111)] in CONNECT(xx.xxx.xxx.xx, '****', '****', db_name) in /var/www/html/includes/adodb/adodb-errorhandler.inc.php on line 77


NOW if i change the hostname to "localhost" and go back to the sourcebans.yourdomainname.com , well it actually works and shows the webpanel. But i then used that "localhost" and whatever was in that config that was working for the website and added it to my gameserver and it didnt ban the player and show up on sourcebans.yourdomainname.com. This is really confusing
Image
User avatar
rlm850
This is my homepage
This is my homepage
Posts: 141
Joined: Thu Dec 10, 2009 12:17 am
Location: Staten Island, NY
Contact:

Re: Transfering db

Post by rlm850 »

justin2234 wrote:I tried the first one you said about just changing the database..
..and this was my outcome -------
Warning: mysqli_real_connect(): (HY000/2002): Connection refused in /usr/www/xxx/public/bans/includes/adodb/drivers/adodb-mysqli.inc.php on line 117

Fatal error: mysqli error: [2002: Connection refused] in CONNECT(xx.xx.xxx[<- my ip went here]), '****', '****', xxx_globalbans) in /usr/www/xxx/public/bans/includes/adodb/adodb-errorhandler.inc.php on line 77
I assume you reflected the database changes in the sourcebans config file (?), as the error shows your website is trying to access the mysql database but is failing (obviously). Remember, your DB Host should know by your VDS IP that MySQL is running on.

justin2234 wrote:So yes i exported all ftp/db from webhosting to vds. The sourcebans is now installed on the vds main ip http://67.432.332.46 (for example) i did not add a subdomain to the vds.
Now i went to the config for the vds sourcebans files. And i changed host to: 67.432.332.46 and the user/pass to phpmyadmin user/pass and also the db name i changed to correct name. Now heres the wierd part, this is my errors when i do that and its all set up correctly with the type "A" pointing at the correct domain, which is sourcebans.domainname.com: Warning: mysqli_real_connect(): (HY000/2003): Can't connect to MySQL server on 'xx.xxx.xxx.xx' (111) in /var/www/html/includes/adodb/drivers/adodb-mysqli.inc.php on line 117

Fatal error: mysqli error: [2003: Can't connect to MySQL server on 'xx.xxx.xxx.xx' (111)] in CONNECT(xx.xxx.xxx.xx, '****', '****', db_name) in /var/www/html/includes/adodb/adodb-errorhandler.inc.php on line 77
(I sure hope that really is an example, because IPv4 subnets don't increment above 255 :P)

Yes, if you change the sourcebans config back to 'localhost' and the original settings, it will start communicating with your website MySQL again, thus working correctly (in its default state).

I am not big on MySQL errors, but I do know how to get what should be working; working from the start.
As far as your error goes, this is what I've found: http://www.filonov.com/2009/08/07/sqlst ... xx-xxx-13/

May I suggest a clean install of sourcebans, running the setup again - for the new database information that is on your VDS? You are able to export your bans and import them to the new install (if you have any) swiftly, just change your sourcebans config info back to its database on the website (the original one).

In addition, if bans are not writing, please make sure you also update your databases.cfg file in your /addons/sourcemod/configs folder.

I just got home from work, and I'm going back in at 6am EST (sigh), so I'll probably be up the rest of the night.
http://www.steamcommunity.com/id/oclwhitey
User avatar
rlm850
This is my homepage
This is my homepage
Posts: 141
Joined: Thu Dec 10, 2009 12:17 am
Location: Staten Island, NY
Contact:

Re: Transfering db

Post by rlm850 »

Issue has been resolved with user via steam.
Post Reply