diff --git a/docs/databases/mysql/mysqldump-database-backup-short/index.md b/docs/databases/mysql/mysqldump-database-backup-short/index.md deleted file mode 100644 index 2347ccd3e58..00000000000 --- a/docs/databases/mysql/mysqldump-database-backup-short/index.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -author: - name: Linode - email: docs@linode.com -description: "Shortguide for backing up a MySQL database with mysqldump." -license: '[CC BY-ND 4.0](https://creativecommons.org/licenses/by-nd/4.0)' -keywords: [] -modified: 2018-08-13 -modified_by: - name: Linode -title: "Back up a MySQL database with mysqldump - Shortguide" -published: 2018-08-13 -headless: true ---- - - - -The `mysqldump` command’s general syntax is: - - mysqldump -u [username] -p [databaseName] > [filename]-$(date +%F).sql - -* `mysqldump` prompts for a password before it starts the backup process. -* Depending on the size of the database, it could take a while to complete. -* The database backup will be created in the directory the command is run. -* `-$(date +%F)` adds a timestamp to the filename. - -Example use cases include: - -* Create a backup of an entire Database Management System (DBMS): - - mysqldump --all-databases --single-transaction --quick --lock-tables=false > full-backup-$(date +%F).sql -u root -p - -* Back up a specific database. Replace `db1` with the name of the database you want to back up: - - mysqldump -u username -p db1 --single-transaction --quick --lock-tables=false > db1-backup-$(date +%F).sql - -* Back up a single table from any database. In the example below, `table1` is exported from the database `db1`: - - mysqldump -u username -p --single-transaction --quick --lock-tables=false db1 table1 > db1-table1-$(date +%F).sql - -Here's a breakdown of the `mysqldump` command options used above: - -- `--single-transaction`: Issue a BEGIN SQL statement before dumping data from the server. -- `--quick`: Enforce dumping tables row by row. This provides added safety for systems with little RAM and/or large databases where storing tables in memory could become problematic. -- `--lock-tables=false`: Do not lock tables for the backup session. diff --git a/docs/databases/mysql/mysqldump-database-restore-short/index.md b/docs/databases/mysql/mysqldump-database-restore-short/index.md deleted file mode 100644 index 88b12ef04f7..00000000000 --- a/docs/databases/mysql/mysqldump-database-restore-short/index.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -author: - name: Linode - email: docs@linode.com -description: "Shortguide for restoring a mysqldump database with MySQL." -license: '[CC BY-ND 4.0](https://creativecommons.org/licenses/by-nd/4.0)' -keywords: [] -modified: 2018-08-13 -modified_by: - name: Linode -title: "Restore a MySQL database from mysqldump - Shortguide" -published: 2018-08-13 -headless: true ---- - - - -The restoration command's general syntax is: - - mysql -u [username] -p [databaseName] < [filename].sql - -* Restore an entire DBMS backup. You will be prompted for the MySQL root user's password:\ - **This will overwrite all current data in the MySQL database system** - - mysql -u root -p < full-backup.sql - -* Restore a single database dump. An empty or old destination database must already exist to import the data into, and the MySQL user you're running the command as must have write access to that database: - - mysql -u [username] -p db1 < db1-backup.sql - -* Restore a single table, you must have a destination database ready to receive the data: - - mysql -u dbadmin -p db1 < db1-table1.sql diff --git a/docs/databases/mysql/use-mysqldump-to-back-up-mysql-or-mariadb/index.md b/docs/databases/mysql/use-mysqldump-to-back-up-mysql-or-mariadb/index.md index 799d5ef9a6e..e4968a74ada 100644 --- a/docs/databases/mysql/use-mysqldump-to-back-up-mysql-or-mariadb/index.md +++ b/docs/databases/mysql/use-mysqldump-to-back-up-mysql-or-mariadb/index.md @@ -33,7 +33,34 @@ The instructions in this guide apply to both MySQL and MariaDB. For simplificati ## Back up a Database -{{< content "mysqldump-database-backup-short" >}} +The `mysqldump` command’s general syntax is: + + mysqldump -u [username] -p [databaseName] > [filename]-$(date +%F).sql + +* `mysqldump` prompts for a password before it starts the backup process. +* Depending on the size of the database, it could take a while to complete. +* The database backup will be created in the directory the command is run. +* `-$(date +%F)` adds a timestamp to the filename. + +Example use cases include: + +* Create a backup of an entire Database Management System (DBMS): + + mysqldump --all-databases --single-transaction --quick --lock-tables=false > full-backup-$(date +%F).sql -u root -p + +* Back up a specific database. Replace `db1` with the name of the database you want to back up: + + mysqldump -u username -p db1 --single-transaction --quick --lock-tables=false > db1-backup-$(date +%F).sql + +* Back up a single table from any database. In the example below, `table1` is exported from the database `db1`: + + mysqldump -u username -p --single-transaction --quick --lock-tables=false db1 table1 > db1-table1-$(date +%F).sql + +Here's a breakdown of the `mysqldump` command options used above: + +- `--single-transaction`: Issue a BEGIN SQL statement before dumping data from the server. +- `--quick`: Enforce dumping tables row by row. This provides added safety for systems with little RAM and/or large databases where storing tables in memory could become problematic. +- `--lock-tables=false`: Do not lock tables for the backup session. ## Automate Backups with cron @@ -61,4 +88,19 @@ password = MySQL root user's password ## Restore a Backup -{{< content "mysqldump-database-restore-short" >}} +The restoration command's general syntax is: + + mysql -u [username] -p [databaseName] < [filename].sql + +* Restore an entire DBMS backup. You will be prompted for the MySQL root user's password:\ + **This will overwrite all current data in the MySQL database system** + + mysql -u root -p < full-backup.sql + +* Restore a single database dump. An empty or old destination database must already exist to import the data into, and the MySQL user you're running the command as must have write access to that database: + + mysql -u [username] -p db1 < db1-backup.sql + +* Restore a single table, you must have a destination database ready to receive the data: + + mysql -u dbadmin -p db1 < db1-table1.sql diff --git a/docs/networking/ssh/using-ssh-on-windows/index.md b/docs/networking/ssh/using-ssh-on-windows/index.md index a3635ae932d..0024e213f01 100644 --- a/docs/networking/ssh/using-ssh-on-windows/index.md +++ b/docs/networking/ssh/using-ssh-on-windows/index.md @@ -13,7 +13,7 @@ published: 2009-09-20 title: Using SSH on Windows --- - +![Using SSH on Windows](using-ssh-on-windows.png "Using SSH on Windows") ## OpenSSH As of late 2018, [OpenSSH](https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_overview) is included with some versions of Windows. diff --git a/docs/networking/ssh/using-ssh-on-windows/using-putty.png b/docs/networking/ssh/using-ssh-on-windows/using-putty.png deleted file mode 100644 index cce1506d735..00000000000 Binary files a/docs/networking/ssh/using-ssh-on-windows/using-putty.png and /dev/null differ diff --git a/docs/networking/ssh/using-ssh-on-windows/using-ssh-on-windows.png b/docs/networking/ssh/using-ssh-on-windows/using-ssh-on-windows.png new file mode 100644 index 00000000000..b22eecfb38b Binary files /dev/null and b/docs/networking/ssh/using-ssh-on-windows/using-ssh-on-windows.png differ diff --git a/docs/platform/disk-images/copy-disk-over-ssh-short/index.md b/docs/platform/disk-images/copy-disk-over-ssh-short/index.md deleted file mode 100644 index 3cf5aed6ed6..00000000000 --- a/docs/platform/disk-images/copy-disk-over-ssh-short/index.md +++ /dev/null @@ -1,81 +0,0 @@ ---- -author: - name: Linode - email: docs@linode.com -description: "Shortguide for copying a disk over SSH." -license: '[CC BY-ND 4.0](https://creativecommons.org/licenses/by-nd/4.0)' -keywords: [] -modified: 2019-01-15 -modified_by: - name: Linode -title: "Copy Disk Over SSH Shortguide" -published: 2018-08-10 -headless: true ---- - -## Boot into Rescue Mode - -1. Prepare the receiving computer by verifying that SSH is installed. Most Linux/Unix-like systems include OpenSSH in their package base by default. If the receiving system is Microsoft Windows, there are multiple SSH solutions available such as [Cygwin and PuTTY](/docs/networking/ssh/using-ssh-on-windows). - -1. Reboot Your Linode into [rescue mode](/docs/troubleshooting/rescue-and-rebuild/#booting-into-rescue-mode) and connect to it using [Lish](/docs/platform/manager/remote-access/#console-access). - -1. Set a root password for the rescue system and start the SSH server: - - passwd - service ssh start - -## Copy and Download the Disk - -1. Copy the disk over SSH from the Linode to the receiving machine. Replace `192.0.2.9` with the Linode's IP address and `/home/archive/linode.img` with the path where you want to store the disk. - - ssh root@192.0.2.9 "dd if=/dev/sda " | dd of=/home/archive/linode.img - - {{< note >}} -The device `/dev/sda` is used for Linodes running on KVM. If your Linode is still using XEN, then use `/dev/xvda` throughout this guide instead. -{{< /note >}} - -1. The receiving machine will connect to the Linode. Verify the SSH key fingerprints. If valid, type `yes` and press **Enter** to continue: - - The authenticity of host '192.0.2.9 (192.0.2.9)' can't be established. - RSA key fingerprint is 39:6b:eb:05:f1:28:95:f0:da:63:17:9e:6b:6b:11:4a. - Are you sure you want to continue connecting (yes/no)? yes - -1. Enter the root password you created above for the rescue system: - - Warning: Permanently added '192.0.2.9' (RSA) to the list of known hosts. - root@192.0.2.9's password: - - When the transfer completes, you'll see a summary output similar to below: - - {{< output >}} - 4096000+0 records in - 4096000+0 records out - 2097152000 bytes (2.1 GB) copied, 371.632 seconds, 5.6 MB/s - {{}} - - Copying your disk can take a while. If you have a slow internet connection, add the `-C` option to the SSH command to enable gzip compression of the disk image. If you receive a `Write failed: Broken pipe` error, repeat this process. - -## Verify the Disk - -Once the copy has completed, verify it by mounting the image on the receiving machine. - -1. Switch users to `root` on receiving machine: - - su - -1. Make a directory to mount the disk as: - - mkdir linode - -1. Mount the disk. Replace `linode.img` with the name of the of your Linode's disk. - - mount -o loop linode.img linode - -1. List the directories on the disk to indicate if everything has transferred. Your output of `ls` is similar to below: - - ls linode - - {{< output >}} - bin dev home lost+found mnt proc sbin srv tmp var - boot etc lib media opt root selinux sys usr -{{< /output >}} \ No newline at end of file diff --git a/docs/platform/disk-images/copying-a-disk-image-over-ssh/copying_a_disk_over_ssh_smg.png b/docs/platform/disk-images/copying-a-disk-image-over-ssh/copying_a_disk_over_ssh_smg.png index 7c4f0aa3912..d04b1a2a04b 100644 Binary files a/docs/platform/disk-images/copying-a-disk-image-over-ssh/copying_a_disk_over_ssh_smg.png and b/docs/platform/disk-images/copying-a-disk-image-over-ssh/copying_a_disk_over_ssh_smg.png differ diff --git a/docs/platform/disk-images/copying-a-disk-image-over-ssh/index.md b/docs/platform/disk-images/copying-a-disk-image-over-ssh/index.md index e1860ecfcbb..dc5323642c8 100644 --- a/docs/platform/disk-images/copying-a-disk-image-over-ssh/index.md +++ b/docs/platform/disk-images/copying-a-disk-image-over-ssh/index.md @@ -13,13 +13,80 @@ published: 2012-06-04 title: "Copy a Disk Over SSH" --- - +![Copy a Disk Over SSH](copying_a_disk_over_ssh_smg.png "Copy a Disk Over SSH") Piping SSH commands to utilities such as `dd`, `gzip`, or `rsync` is an easy way to copy a Linode's data into a single file for later extraction. This can effectively back up your Linode's disk or migrate your installed system among Linodes. This guide demonstrates how to download a `.img` file to your computer over SSH containing a block-level copy of your Linode's disk device created with `dd`. -{{< content "copy-disk-over-ssh-short" >}} +## Download a Disk over SSH + +### Boot into Rescue Mode + +1. Prepare the receiving computer by verifying that SSH is installed. Most Linux/Unix-like systems include OpenSSH in their package base by default. If the receiving system is Microsoft Windows, there are multiple SSH solutions available such as [Cygwin and PuTTY](/docs/networking/ssh/using-ssh-on-windows). + +1. Reboot Your Linode into [rescue mode](/docs/troubleshooting/rescue-and-rebuild/#booting-into-rescue-mode) and connect to it using [Lish](/docs/platform/manager/remote-access/#console-access). + +1. Set a root password for the rescue system and start the SSH server: + + passwd + service ssh start + +### Copy and Download the Disk + +1. Copy the disk over SSH from the Linode to the receiving machine. Replace `192.0.2.9` with the Linode's IP address and `/home/archive/linode.img` with the path where you want to store the disk. + + ssh root@192.0.2.9 "dd if=/dev/sda " | dd of=/home/archive/linode.img + + {{< note >}} +The device `/dev/sda` is used for Linodes running on KVM. If your Linode is still using XEN, then use `/dev/xvda` throughout this guide instead. +{{< /note >}} + +1. The receiving machine will connect to the Linode. Verify the SSH key fingerprints. If valid, type `yes` and press **Enter** to continue: + + The authenticity of host '192.0.2.9 (192.0.2.9)' can't be established. + RSA key fingerprint is 39:6b:eb:05:f1:28:95:f0:da:63:17:9e:6b:6b:11:4a. + Are you sure you want to continue connecting (yes/no)? yes + +1. Enter the root password you created above for the rescue system: + + Warning: Permanently added '192.0.2.9' (RSA) to the list of known hosts. + root@192.0.2.9's password: + + When the transfer completes, you'll see a summary output similar to below: + + {{< output >}} + 4096000+0 records in + 4096000+0 records out + 2097152000 bytes (2.1 GB) copied, 371.632 seconds, 5.6 MB/s + {{}} + + Copying your disk can take a while. If you have a slow internet connection, add the `-C` option to the SSH command to enable gzip compression of the disk image. If you receive a `Write failed: Broken pipe` error, repeat this process. + +### Verify the Disk + +Once the copy has completed, verify it by mounting the image on the receiving machine. + +1. Switch users to `root` on receiving machine: + + su + +1. Make a directory to mount the disk as: + + mkdir linode + +1. Mount the disk. Replace `linode.img` with the name of the of your Linode's disk. + + mount -o loop linode.img linode + +1. List the directories on the disk to indicate if everything has transferred. Your output of `ls` is similar to below: + + ls linode + + {{< output >}} + bin dev home lost+found mnt proc sbin srv tmp var + boot etc lib media opt root selinux sys usr +{{< /output >}} ## Upload a Disk over SSH diff --git a/docs/security/data-portability/download-backups-locally/index.md b/docs/security/data-portability/download-backups-locally/index.md index 885ed6ff25a..24c8f06b14d 100644 --- a/docs/security/data-portability/download-backups-locally/index.md +++ b/docs/security/data-portability/download-backups-locally/index.md @@ -16,8 +16,8 @@ The [Linode Backups](/docs/platform/disk-images/linode-backup-service/) service Linode's backups are stored in a way that is only directly readable by the Linode Backups service. A common question for the service is how you can download the content from your Linode Backups to another storage location, like your home computer. This can be accomplished in two phases: -1. Restore a backup to a new or existing Linode. -2. Download either specific files or the entire disk image from that Linode, as needed. +1. [Restore a backup](#restore-from-a-backup) to a new or existing Linode. +2. Download either [specific files](#download-specific-files-or-directories-over-ssh) or the [entire disk image](#download-a-disk-over-ssh) from that Linode, as needed. ## Before You Begin diff --git a/docs/security/data-portability/download-files-from-your-linode-shortguide/index.md b/docs/security/data-portability/download-files-from-your-linode-shortguide/index.md index 604b8212d82..00c04b4fff1 100644 --- a/docs/security/data-portability/download-files-from-your-linode-shortguide/index.md +++ b/docs/security/data-portability/download-files-from-your-linode-shortguide/index.md @@ -13,7 +13,11 @@ title: Download Files from your Linode - Shortguide headless: true --- -## Secure Copy Protocol (SCP) +## Download Specific Files or Directories over SSH + +If you just need specific files from your Linode, you can download those over SSH. Downloading files over SSH can be done at a command-line interface, or with a graphical *SFTP* file browser. + +### Secure Copy Protocol (SCP) You can use SCP to retrieve a specific directory or file via the command-line. SCP is installed by default on most macOS and Linux systems, and is available with [Cygwin or PuTTY](/docs/networking/ssh/using-ssh-on-windows) for Windows. @@ -51,23 +55,22 @@ For example: If you intend to repeat this process regularly, consider [using rsync](/docs/security/backups/backing-up-your-data/#understand-the-rsync-command) to create additional local copies of your data. rsync is capable of performing incremental file copies, which means you do not have to fully transfer each file every time you download your data. - -## FileZilla +### FileZilla FileZilla is a popular free and open source FTP, FTPS, and SFTP client which has a GUI but can also take CLI arguments. In contrast to to SCP, SFTP can list directory contents, create or delete files, and resume interrupted file transfers. See our [FileZilla guide](http://localhost:1313/docs/tools-reference/file-transfer/filezilla/) for more information. -## Downloading Data from a Database +### Downloading Data from a Database + +Special care is needed when downloading data from a database. Before it can be downloaded, the data in a database needs to first be *dumped* to a file. This database dump file can then be transferred just as any other normal file type. -Special care is needed when downloading data from a database. Before it can be downloaded, the data in a database needs to first be *dumped* to a file. This file can then be transferred just as any other normal file type. +- To create a dump of a MySQL (or MariaDB) database, [use the `mysqldump` command](/docs/databases/mysql/use-mysqldump-to-back-up-mysql-or-mariadb). **You can only use this tool if your database process is accessible and running.** -To create a dump of a MySQL (or MariaDB) database, [use the `mysqldump` command](/docs/databases/mysql/use-mysqldump-to-back-up-mysql-or-mariadb) as in the following instructions. **You can only use this tool if your database process is accessible and running.** +- If your MySQL database won't run for some reason, follow the instructions for creating [*physical* backups](/docs/databases/mysql/create-physical-backups-of-your-mariadb-or-mysql-databases/). -{{< note >}} -An alternative to using `mysqldump` is to create [*physical* backups](/docs/databases/mysql/create-physical-backups-of-your-mariadb-or-mysql-databases/). If you use PostgreSQL, follow the [How to Back Up Your PostgreSQL Database](/docs/databases/postgresql/how-to-back-up-your-postgresql-database/) guide instead. -{{< /note >}} +- If you use PostgreSQL, follow the [How to Back Up Your PostgreSQL Database](/docs/databases/postgresql/how-to-back-up-your-postgresql-database/) guide. -{{< content "mysqldump-database-backup-short" >}} +## Download a Disk over SSH -{{< content "copy-disk-over-ssh-short" >}} \ No newline at end of file +Downloading your disk will copy a `.img` file to your computer that encapsulates all of the data that is on your Linode’s disk. This *disk image* can later be re-uploaded to the Linode service at a later date, which can be useful if you'd like to temporarily remove your Linode and stop service. Follow our [Copy a Disk over SSH](/docs/platform/disk-images/copying-a-disk-image-over-ssh/) guide for further instructions. \ No newline at end of file diff --git a/docs/tools-reference/file-transfer/filezilla-shortguide/index.md b/docs/tools-reference/file-transfer/filezilla-shortguide/index.md deleted file mode 100644 index 5f799b7edd7..00000000000 --- a/docs/tools-reference/file-transfer/filezilla-shortguide/index.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -author: - name: Linode - email: docs@linode.com -description: 'Shortguide which shows how to use FileZilla after it has been installed.' -license: '[CC BY-ND 4.0](https://creativecommons.org/licenses/by-nd/4.0)' -keywords: [] -aliases: ['networking/file-transfer/transfer-files-filezilla/'] -modified: 2019-01-15 -modified_by: - name: Linode -published: 2018-08-14 -title: 'Transfer Files with FileZilla' -headless: true ---- - -FileZilla is a popular free and open source FTP, FTPS, and SFTP client which has a GUI but can also take CLI arguments. In contrast to to SCP, SFTP can list directory contents, create or delete files, and resume interrupted file transfers. - - 1. Download FileZilla [here](https://filezilla-project.org/download.php) for macOS and Windows. Use your distribution's package manager to install FileZilla on Linux: - - - CentOS: - - sudo yum install filezilla - - - Debian / Ubuntu: - - sudo apt install filezilla - -1. Launch FileZilla and enter your Linode's IP address or domain name in the `Host` field. Enter the username and password for the account on the Linode you want to connect as, and enter "22" in the `Port` field. Click **Quickconnect** to initiate the file transfer session. - - {{< image src="filezilla-quick-connect.png" alt="Quickconnect" title="FileZilla Quickconnect screenshot" >}} - -1. If this is the first time you've connected to your Linode by SSH or SFTP, you'll receive a warning that the host key is unknown. Verify the host key fingerprints and if valid, check the box next to `Always trust this host, add this key to the cache`. This prevents further warnings unless the key presented to FileZilla changes, which should only happen if you reinstall the remote server's operating system. - - {{< image src="filezilla-unknown-key.png" alt="Unknown Key" title="FileZilla Unknown Key warning" >}} - -1. Click the **OK** button to proceed. You'll be presented with a split view, with your local filesystem on the left and your Linode's filesystem on the right. You can transfer files by dragging and dropping them from one side to the other.