arrow_upward

Pages (2):
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Corrected - refer last post] Migrate Your Website to New VPS Host ( Ubuntu/Debian )
#11
@Rehan

Next time you need to transfer a file from VPS-A to VPS-B, use the scp -secure copy- tool, like so, while logged-in VPS-A:
scp -P VPS-B_SSH_PORT /home/username/random_path/arhive.tar.xz VPS-B_IP:/home/username/random_path/

Of course, you can drop the -P flag if the VPS-B_SSH_PORT is the default port.

You can also transfer an entire folder by adding the -r flag.

Good luck!
VirMach's Buffalo_VPS-9 Holder (Dec. 20 - July 21)
microLXC's Container Holder (july 20 - ?)
VirMach's Phoenix_VPS-9 Holder (Apr. 20 - June 20)
NanoKVM's NAT-VPS Holder (jan. 20 - ?)
#12
(12-16-2020, 07:39 AM)fChk Wrote: @Rehan

Next time you need to transfer a file from VPS-A to VPS-B, use the scp -secure copy- tool, like so, while logged-in VPS-A:
scp -P VPS-B_SSH_PORT /home/username/random_path/arhive.tar.xz VPS-B_IP:/home/username/random_path/

Of course, you can drop the -P flag if the VPS-B_SSH_PORT is the default port.

You can also transfer an entire folder by adding the -r flag.

Good luck!

Appreciated! Thank you @fChk for the information. It was a very hard task to transfer files from VPS to VPS. Sometimes google drive does not works properly on VPS and sometimes multicloud fail to tranfer files from google drive to others.But i hope now it will be very easy to move/copy files from VPS to VPS.

Thanks to Post4VPS and Hostlease for their great services.  
#13
(12-17-2020, 01:12 PM)Rehan Wrote: Appreciated! Thank you @fChk for the information. It was a very hard task to transfer files from VPS to VPS. Sometimes google drive does not works properly on VPS and sometimes multicloud fail to tranfer files from google drive to others.But i hope now it will be very easy to move/copy files from VPS to VPS.

That's because you were using the wrong tools for the job. scp is the tool you were looking for; that's why I did the previous post for a heads-up!.. and you have Mybb to thank for me noticing the thread --It came as a related topic while I was reviewing a thread of mine.

The scp tool was created for just that job and can do both downloads from another VPS or an upload to it. The example I've given was the upload case, you can look up for the other.
VirMach's Buffalo_VPS-9 Holder (Dec. 20 - July 21)
microLXC's Container Holder (july 20 - ?)
VirMach's Phoenix_VPS-9 Holder (Apr. 20 - June 20)
NanoKVM's NAT-VPS Holder (jan. 20 - ?)
#14
@Rehan

(08-22-2019, 08:47 AM)Rehan Wrote: Database Export via Terminal

mysqldump -u [username] -p [database name] > [database name].sql
It's always wise to use the host and port flags to explicitly set the server we're communicating with; the above command assumes a lot of things that aren't always correct. In addition to that, it's always a good idea to also explicitly mention the default-character-set to be used in that backup process (to avoid ending up with garbage text in the database. Bellow I used UTF-8, but you should use the one that you're database is using.

Taking into account the above remarks, the command should be something like:
mysqldump  --opt -u [username] -p --host=DB_SERVER_IP --port=DB_SERVER_PORT --default-character-set=utf8 --databases DB1_NAME DB2_NAME etc.. > ~/random_path/db_dump.sql

(08-22-2019, 08:47 AM)Rehan Wrote: (...........)
CREATE DATABASE newdb;
(...)
Use the following command to restore the database

mysqldump -u [username] -p [database name] < [database name].sql

Database restore is completed now (..................)
That's WRONG!.. To restore A MySQL data_dump we use the 'mysql' commandline utility NOT mysqldump, like so:

mysql -u [username] -p --host DB_SERVER_IP --port DB_SERVER_PORT --default-character-set=utf8 --one-database DB1_NAME < ~/random_path/db_dump.sql

mysql -u [username] -p --host DB_SERVER_IP --port DB_SERVER_PORT --default-character-set=utf8 --one-database DB2_NAME < ~/random_path/db_dump.sql

etc......................

That's the way to do it!..
VirMach's Buffalo_VPS-9 Holder (Dec. 20 - July 21)
microLXC's Container Holder (july 20 - ?)
VirMach's Phoenix_VPS-9 Holder (Apr. 20 - June 20)
NanoKVM's NAT-VPS Holder (jan. 20 - ?)
#15
@Rehan

This is my last post in this thread where I've tried to correct with actual code the OP's shortcomings. In this post, I'll just address the flawed logic with which you wrote this tutorial and which triggered the complaints posted in the earlier responses.

The flawed logic:
1-Dump the database data in an sql file
2-Pack it with the website root folder
3-Transfer it (somehow) to the new VPS
4-Unpack the payload, then reload the sql data into the database
5-Transfer the website folder to the webserver/Apache document root
6-Set/Configure the website in the Apache server (config file)
7-Reload the webserver and we are done!?

The first thing that came to my mind when I first read this tutorial is that this fellow is still thinking as a Webmaster not as sysAdmin!.. and that's what generated the above flawed logic of the tutorial and that's why the earlier posts where complaining about the title, which should be: 'Migrate Your Website to New Web Hosting' instead to 'Migrate Your Website to New VPS'.

What's missing is all the sysAdmin(/sysOps) routines, ie how to set the Mysql/MariaDB server from start to finish and how to set the Apache server (also) from start to finish and only then we start configuring our data (sql + website assets.) And this part is missing because you were writing with a webmaster mindset not a sysAdmin's.

I think I said it all and hope you learned something from all this prose :-)

PS: I may write few tutorials of my own on this, as I always compile my own Webservers from source along with PHP. It should be educational for folks new in this business.
VirMach's Buffalo_VPS-9 Holder (Dec. 20 - July 21)
microLXC's Container Holder (july 20 - ?)
VirMach's Phoenix_VPS-9 Holder (Apr. 20 - June 20)
NanoKVM's NAT-VPS Holder (jan. 20 - ?)
#16
Thanks for reviewing the tutorial and correcting this @fChk.  Would be nice if you could provide a tutorial of your own if and when you have time to do so.

- closed -
Terminal
Thank you to Post4VPS and VirMach for my awesome VPS 9!  
Pages (2):



person_pin_circle Users browsing this thread: 1 Guest(s)
Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - Hyper Expert - Shadow Hosting - Bladenode - Hostlease - RackNerd - ReadyDedis - Limitless Hosting