One place for hosting & domains

      backup

      The Linode Backup Service


      Updated by Linode

      Written by Alex Fornuto

      The Linode Backup Service

      The Linode Backup Service is a subscription service add-on that automatically performs daily, weekly, and biweekly backups of your Linode. It’s affordable, easy to use, and provides peace of mind. This guide explains how to enable and schedule your backups, make a manual backup snapshot, restore from a backup, and disable the Backup Service.

      Pricing

      Pricing is per Linode and varies depending upon your Linode’s plan:

      Standard Plans

      Service Backups Hourly Rate Backups Monthly
      Linode 1GB $0.003/hr $2/mo
      Linode 2GB $0.004/hr $2.50/mo
      Linode 4GB $0.008/hr $5/mo
      Linode 8GB $0.016/hr $10/mo
      Linode 16GB $0.03/hr $20/mo
      Linode 32GB $0.06/hr $40/mo
      Linode 64GB $0.12/hr $80/mo
      Linode 96GB $0.18/hr $120/mo
      Linode 128GB $0.24/hr $160/mo
      Linode 192GB $0.36/hr $240/mo

      High Memory Plans

      Service Backups Hourly Rate Backups Monthly
      Linode 24GB $0.0075/hr $5/mo
      Linode 48GB $0.015/hr $10/mo
      Linode 90GB $0.03/hr $20/mo
      Linode 150GB $0.06/hr $40/mo
      Linode 300GB $0.12/hr $80/mo

      Enable the Backup Service

      Use the Linode Manager to enable the Backup Service on a Linode. Here’s how:

      1. Log in to the Linode Cloud Manager.

      2. From the Linodes screen, select the Linode you want to back up.

      3. Click the Backups tab.

        Enable Linode Backups by navigating to to the individual Linode's backup menu.

      4. Click Enable Backups.

      The Linode Backup Service is now enabled for the selected Linode.

      Auto Enroll New Linodes in the Backup Service

      You can automatically enroll all new Linodes in the Backup Service. To do so, navigate to the Account page in the left-hand navigation, then select the Global Settings tab.

      Under Backup Auto Enrollment click on the toggle button to enable backups on all new Linodes.

      Auto enroll all new Linodes in the Backup Service by navigating to the Global Settings tab in the Account settings and enabling Backups.

      Note

      Enabling this setting does not retroactively enroll any previously created Linodes in the Backup Service.

      Manage Backups

      You’ll manage your backups with a simple web interface in the Linode Manager. There’s no software to install, and there are no commands to run. Just log in to the Linode Manager, navigate to the Linodes screen, select a Linode, and then click the Backups tab. The backups interface is shown below.

      The Linode Backup Service interface

      1. A list of available backups. Listed in this view are the date created, the label, how long the backup took to be created, the disks imaged, and the size of the resulting image.

      2. Manually create a backup by taking a manual snapshot. For more information, see the Take a Manual Snapshot section.

      3. Configure backup schedule settings. For more information, see the Schedule Backups section.

      4. Cancel backups. After cancelling your backups you will have to wait 24 hours before you can re-enable them again.

      How Linode Backups Work

      Backups are stored on a separate system in the same data center as your Linode. The space required to store the backups is not subtracted from your storage space. You can store four backups of your Linode, three of which are automatically generated and rotated:

      • Daily backup: Automatically initiated daily within the backup window you select. Less than 24 hours old.
      • Current week’s backup: Automatically initiated weekly within the backup window, on the day you select. Less than 7 days old.
      • Last week’s backup: Automatically initiated weekly within the backup window, on the day you select. Between 8 and 14 days old.
      • Manual Snapshot: A user-initiated snapshot that stays the same until another snapshot is initiated.

      The daily and weekly backups are automatically erased when a new backup is performed. The Linode Backup Service does not keep automated backups older than 8 – 14 days.

      Schedule Backups

      You can configure when automatic backups are initiated. Here’s how:

      1. From the Linodes page, select the Linode.

      2. Click the Backups tab.

      3. Under Settings, select a time interval from the Time of Day menu. The Linode Backup Service will generate all backups between these hours.

      4. Select a day from the Day of Week menu. This is the day whose backup will be promoted to the weekly slot. The back up will be performed within the time period you specified in step 3.

      5. Click Save Changes.

      The Linode Backup Service will backup your Linode according to the schedule you specified.

      Take a Manual Snapshot

      You can make a manual backup of your Linode by taking a snapshot. Here’s how:

      1. From the Linodes page, select the Linode.

      2. Click the Backups tab.

      3. Under Manual Snapshot, give your snapshot a name and click Take Snapshot.

        Note

        Taking a new snapshot will overwrite a previously saved snapshot.

      The Linode Backup Service initiates the manual snapshot. Creating the manual snapshot can take several minutes, depending on the size of your Linode and the amount of data you have stored on it. Other Linode Manager jobs for this Linode will not run until the snapshot job has been completed.

      Restore from a Backup

      This section shows how to restore a backup to a new Linode, or to an existing Linode.

      Restoring a backup will create a new configuration profile and a new set of disks on your Linode. The restore process does not restore single files or directories automatically. Restoring particular files can be done by completing a normal restore, copying the files off of the new disks, and then removing the disks afterward.

      Note

      The size of the disk(s) created by the restore process will only be slightly larger than the total size of the files restored. This means that the disk(s) created will be ‘full’.

      Some applications, like databases, need some amount of free unused space inside the disk in order to run. As a result, you may want to increase your disk(s) size after the restore process is completed.

      To restore a backup to a different data center, first restore to a Linode in the same data center, creating a new one if necessary. Once the restore is complete, use the Clone tab to copy the disk(s) to a Linode in a different data center.

      Restore to a New Linode

      This section covers how to restore a backup to a new Linode that does not have any disks deployed to it. The new Linode will be located in the same data center. If you instead wish to restore your backup to an existing Linode, see the next section.

      1. From Linodes page, select the Linode whose backups you intend to restore, and then click on the Backups tab. Select the ellipsis (three dots) next to the backup you would like to restore, and click Deploy New Linode.

        Click on the ellipsis menu icon to restore to a new Linode.

      2. You will be taken to the Create New Linode screen. The Create from Backup tab will already be selected for you, as will the fields corresponding to the Linode and backup that you are restoring from. Choose a Linode plan, enter a label for the new Linode, select any other options you prefer, and click Create. The new Linode will be created with the same password and SSH keys (if any) as the original.

        The backup disks and configuration profiles will be restored to the Linode you selected. Watch the notifications area for updates on the process. Restoring from a backup can take several minutes depending on the size of your Linode and the amount of data you have stored on it.

      Restore to an Existing Linode

      You can restore a backup to any Linode located in the same data center, even if the target does not have the Backup Service enabled. To restore a backup to an existing Linode, you will need to make sure that you have enough storage space that is not currently assigned to disk images.

      Note

      If you are attempting to restore a disk to the same Linode the backup was created from, the restoration process will not delete the original disk for you. Manually delete the original disk to make room for the backup, if desired.

      1. From Linodes page, select the Linode whose backups you intend to restore, and then click on the Backups tab. Observe the size of the backup you would like to restore, which is visible in the Space Required column. You will need at least this amount of unallocated disk space on the target Linode to complete the restore.

      2. Select the ellipsis (three dots) next to the backup you would like to restore, and click Restore to Existing Linode.

        Click on the ellipsis menu icon to restore to an existing Linode.

      3. A menu will open with the Linodes that you can restore to. Select a Linode and click Restore.

        Select the Linode you would like to restore your backup to.

        You will be notified if you do not have enough space on your Linode to restore your backup. Optionally, you can choose to overwrite the Linode you are restoring to.

      4. If the amount of unallocated space available is greater than the size of the backup, you can proceed with restoring. If the amount of unallocated space is less than the size of the backup, you can stop the restoration workflow, resize your existing disks on the target Linode to make room for it, and then come back to the restore page after the disk resize operation has finished.

        Note

        In some cases, you will not be able to shrink your disks enough to fit the restored backup. As an alternative, you can change your Linode’s plan to a higher tier that offers more disk space.
      5. From the Restore to Existing Linode menu, click Restore.

        Your backup will begin restoring to your Linode, and you can monitor its progress in the notifications area. Note that the time it takes to restore your backup will vary depending upon the restore size, and the number of files being restored.

      Boot from a Backup

      After the backup has been restored, the disks and configuration profiles will be available to the destination Linode you selected. Select the restored configuration profile and reboot your Linode to start up from the restored disks:

      1. From the Linodes page, select the Linode that you restored the backup to. Navigate to the Settings tab and open the Advanced Configurations section.

      2. Select the ellipsis icon (three dots) next to the configuration profile that was restored and select Boot This Config.

        Navigate to the Advanced Configurations section of your Linode's Settings tab.

      The Linode will start from the backup disks. Monitor the notifications area for progress.

      Cancel the Backup Service

      You can cancel the Backup Service at any time. From your Linode’s dashboard, choose the Backups tab and click the Cancel Backups link at the bottom of the page. Cancelling the service will remove your saved backups from the Linode platform.

      Limitations

      There are some limitations to what the Linode Backup Service can back up. Here are some things you should be aware of:

      • The Backup Service must be able to mount your disks. If you’ve created partitions, configured full disk encryption, or made other changes that prevent us from mounting the disk as a filesystem, you will likely not be able to use the Linode Backup Service. The backup system operates at the file level, not at the block level.
      • Because the Backup Service is file-based, the number of files stored on disk will impact both the time it takes for backups and restores to complete, and your ability to successfully take and restore backups. Customers who need to permanently store a large number of files may want to archive bundles of smaller files into a single file, or consider other backup services.
      • Backups taken of ext4 or ext3 filesystems will be restored as ext4. Backups taken of other mountable filesystem types will have their contents restored using ext4.
      • Files that have been modified but have the same size and modify time will not be considered “changed” during a subsequent backup. ACLs and extended attributes are not tracked.
      • The Backup Service uses a snapshot of your disks to take consistent backups while your Linode is running. This method is very reliable, but can fail to properly back up the data files for database services like MySQL. If the snapshot occurs during a transaction, the database’s files may be backed up in an unclean state. We recommend scheduling routine dumps of your database to a file on the filesystem. The resulting file will then be backed up, allowing you to restore the contents of the database if you need to restore from a backup.

      Find answers, ask questions, and help others.

      This guide is published under a CC BY-ND 4.0 license.



      Source link

      Download a Local Copy of your Linode Backup


      Updated by Linode

      Written by Edward Angert


      Use promo code DOCS10 for $10 credit on a new account.

      The Linode Backups service can create automatic and manual snapshots of your Linode. A completed backup can be directly restored to the origin Linode or to a new Linode in the same data center. These workflows make it easy to revert to a working configuration if you run into any unexpected issues with your software.

      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 Linode in the same data center.
      2. Download either specific files or the entire disk image from that Linode, as needed.

      Before You Begin

      Account Permissions and Billing

      Several of the steps in this guide involve adding services to or removing services from a Linode account. Visit our guide on Users and Permissions for more information about restricted Linode users.

      Note that the cost of adding Backups service and adding a Linode to your account is billed, prorated per hour. If the backups service is only enabled for a few hours, you will only be charged for a few hours of the service. See the Backups pricing details for more information. Likewise, when you create a Linode, you will be billed per hour that the Linode exists, whether it is powered on or not.

      The steps in this guide have been designed to minimize the potential costs associated with this process. Additionally, keep the following in mind:

      • Removing a Linode from your account also cancels the associated Backup service for that Linode.
      • A Linode’s backups are deleted when a Linode is deleted.
      • If you choose to leave the Backups service enabled, or if you do not remove the additional Linode from your account, you will be automatically billed. If you only power the Linode off, you will still be billed for it.

      Enable Backups and Take a Snapshot

      These steps are the minimum required for the scope of this guide. Visit our Backups guide for information about how to implement regular backups of your Linode.

      1. Go to your Linode’s dashboard, click Backups, click Enable backups for this Linode » and confirm the additional cost per month.

      2. This guide focuses on saving a snapshot or specific backup. Click Take a New Snapshot Now.

        • The snapshot appears in the Backup History at the bottom of the page.

      Restore from a Backup

      This section shows how to restore a backup to a new Linode, or to an existing Linode.

      Restoring a backup will create a new configuration profile and a new set of disks on your Linode. The restore process does not restore single files or directories automatically. Restoring particular files can be done by completing a normal restore, copying the files off of the new disks, and then removing the disks afterward.

      Note

      The size of the disk(s) created by the restore process will only be slightly larger than the total size of the files restored. This means that the disk(s) created will be ‘full’.

      Some applications, like databases, need some amount of free unused space inside the disk in order to run. As a result, you may want to increase your disk(s) size after the restore process is completed.

      To restore a backup to a different data center, first restore to a Linode in the same data center, creating a new one if necessary. Once the restore is complete, use the Clone tab to copy the disk(s) to a Linode in a different data center.

      Restore to a New Linode

      You can restore a backup to any Linode located in the same data center, even if the target does not have the Backup Service enabled. This section covers how to restore a backup to a new Linode that does not have any disks deployed to it. If you wish to restore your backup to an existing Linode, see the next section.

      1. From the Dashboard of the Linode whose backups you intend to restore, click on the Backups tab. Select the Restore to… link beneath the backup version that you want to restore.

      2. Under the Select column, click the Restore to this Linode link next to your new Linode:

        The backup disks and configuration profiles will be restored to the Linode you selected. Watch the Host Job Queue to monitor the progress. Restoring from a backup can take several minutes depending on the size of your Linode and the amount of data you have stored on it.

      Restore to an Existing Linode

      To restore a backup to an existing Linode, you will need to make sure that you have enough storage space that is not currently assigned to disk images.

      Note

      If you are attempting to restore a disk to the same Linode the backup was created from, the restoration process will not delete the original disk for you. Manually delete the original disk to make room for the backup.

      1. Start by confirming the size of the backup that you wish to restore. From the Backups tab in your Linode’s Dashboard, click the Restore to… link beneath your desired backup version.

      2. Check the Total size required field to confirm the size of your backup.

        As an example, if the total size of the backup comes to 3107MB, this means you would need at least that much free space to restore the backup to your Linode.

      3. Next, you’ll confirm the total space assigned to disk images on your Linode, via the Storage indicator on your Linode’s Dashboard.

      4. If the amount of space available is greater than the size of the backup, you can proceed with restoring. If the amount of unallocated space is less than the size of the backup, you can resize your existing disks to make room for it.

        Note

        In some cases, you will not be able to shrink your disks enough to fit the restored backup. As an alternative, you can change your Linode’s plan to a higher tier that offers more disk space.
      5. Once the disk resize has completed, check the storage indicator on your Linode’s Dashboard to confirm that you’ve freed up enough space for your backup.

      6. From the Backups tab, click the Restore to this Linode link next to your Linode.

        Your backup will begin restoring to your Linode, and you can monitor its progress from the Host Job Queue in your Linode’s Dashboard tab. Note that the time it takes to restore your backup will vary depending upon the restore size, and the number of files being restored.

      Download Specific Files or Directories over SSH

      If you just need specific files from your Linode, you can download those over SSH. In order to do so, you’ll first need to reboot your Linode under the new configuration profile that was created by the restore process. This new profile is assigned to the restored disks, and your backed up data will be accessible when you boot from them.

      Downloading files over SSH can be done at a command-line interface, or with a graphical SFTP file browser.

      Using SCP

      To retrieve a specific directory or file via the command-line, you can use the secure copy (SCP) command from your computer. SCP is installed by default on most Mac and Linux systems, and you can install a tool like Cygwin to use it on Windows.

      • The syntax for using SCP to copy a file from your Linode into a directory on your computer is:

        scp your_linode_username@your_linode_ip:/path/to/your/file.txt /path/to/your/local/directory/
        

        The file will be saved inside /path/to/your/local/directory/ on your computer.

      • To copy a file from your Linode to your computer and give it a specific name (in this case, file.txt.backup):

        scp your_linode_username@your_linode_ip:/path/to/your/file.txt /path/to/your/local/directory/file.txt.backup
        
      • To copy a directory from your Linode to your computer:

        scp -r your_linode_username@your_linode_ip:/path/to/your/directory /path/to/your/local/directory
        

        If /path/to/your/local/directory already exists on your computer, then the copied directory will be placed inside /path/to/your/local/directory (i.e. /path/to/your/local/directory/directory).

        If /path/to/your/local/directory does not already exist, then the copied directory will be created with that name.

      For example:

      • Download an NGINX configuration file to your home folder:

        scp your_linode_username@your_linode_ip:/etc/nginx/conf.d/example.com.conf ~/example.com.conf.backup
        
      • Download an Apache configuration file to your home folder:

        scp your_linode_username@your_linode_ip:/etc/apache2/sites-available/example.com.conf ~/example.com.conf.backup
        
      • Copy the entire document root from a web server:

        scp -r your_linode_username@your_linode_ip:/var/www/html/ ~/html_backup
        

      If you intend to repeat this process regularly, consider using rsync 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.

      Using FileZilla

      As an alternative to the command-line, you can download and install an SFTP client. These applications provide a graphical user interface for your Linode’s filesystem.

      FileZilla is a popular free example. Windows and OS X users can download FileZilla here. To install FileZilla on Linux:

      After you’ve installed FileZilla on your computer:

      1. Open FileZilla from your Windows start menu, OS X Launchpad, or the launcher provided by your Linux distribution of choice.

      2. Enter your Linode’s IP address or domain name in the Host field. Enter the account username you wish to connect as in the Username field. Please note that this must be a user account on your Linode; if in doubt, enter root to log in as the root user. Enter the account’s password in the Password field, and enter “22” in the Port field. Click Quickconnect to initiate the file transfer session.

        Quickconnect

      3. If this is the first time you’ve connected to your Linode with an SSH or SFTP program, you’ll receive a warning that the host key is unknown. Place a check mark in the box next to Always trust this host, add this key to the cache. Checking this box prevents further warnings unless the key presented to FileZilla changes; this should only happen if you reinstall the remote server’s operating system.

        Unknown Key

      4. 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 may transfer files by dragging and dropping them between each side.

      For more information on FileZilla, review our full guide on using the application.

      Using mysqldump to Back Up 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 file can then be transferred just as any other normal file type.

      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.

      For more information on MySQL database backups, including how to restore the data in a dump file to a MySQL installation, review our guide on the subject. An alternative to using mysqldump is to create physical backups. It’s also possible to backup PostgreSQL databases.

      Download a Disk over SSH

      Downloading your disk will copy a .img file to your computer that encapsulates all of the data that is on your Linode’s disk.

      Prepare the Receiving Computer

      Verify that the receiving computer has SSH installed. (Most Linux/Unix-like systems have it installed by default.) If you’re running Windows locally, you may wish to set up the Cygwin compatibility layer to provide a reasonably complete Unix-like environment. Instructions on setting up Cygwin are located here.

      Start Your Linode in Rescue Mode

      Before you initiate the transfer, start the source Linode in Rescue Mode and start SSH by following these guides:

      1. Start your Linode in Rescue Mode.
      2. Connecting to a Linode Running in Rescue Mode via LISH.
      3. Start the SSH server on your Linode.

      Copy the Disk

      Now that the Linode is running in Rescue Mode, you can transfer the disk from the Linode to the receiving machine over SSH:

      1. Enter the following command on the receiving machine. Replace 123.45.67.89 with the Linode’s IP address and /home/archive/linode.img with the path where you want to store the disk:

        ssh root@123.45.67.89 "dd if=/dev/sda " | dd of=/home/archive/linode.img
        

        Note

        The device /dev/sda is used for Linodes running on top of KVM. If your Linode is still using XEN, then throughout this guide you must use /dev/xvda instead.

      2. The receiving machine will connect to the Linode. Type yes and press Enter to continue connecting:

        The authenticity of host '123.45.67.89 (123.45.67.89)' 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
        
      3. Enter the root password for the Linode:

        Warning: Permanently added '123.45.67.89' (RSA) to the list of known hosts.
        root@123.45.67.89's password:
        

        The transfer starts, and you’ll see output similar to the following:

          
                4096000+0 records in
                4096000+0 records out
                2097152000 bytes (2.1 GB) copied, 371.632 seconds, 5.6 MB/s
                4096000+0 records in
                4096000+0 records out
                2097152000 bytes (2.1 GB) copied, 364.002 s, 5.8 MB/s
            
        

        Note

        Copying your disk can take a while. Please be patient. If you have a slow internet connection, add the -C option to the SSH command; this enables gzip compression for data transfer. If you receive a Write failed: Broken pipe error, repeat this process.

      Verify the Disk

      Once the copy has completed, you can verify it by mounting the image on the receiving machine.

      1. Log in to the receiving machine as root by entering the following command and entering the root user’s password:

        su
        
      2. Make a directory on the receiving machine by entering the following command:

        mkdir linode
        
      3. Mount the disk by entering the following command, replacing linode.img with the name of the disk:

        mount -o loop linode.img linode
        
      4. View the directories stored on the disk by entering the following command:

        ls linode/
        

        You should see the directories on the disks, similar to the ones shown below, indicating that everything has transferred:

        bin   dev  home  lost+found  mnt  proc  sbin     srv  tmp  var
        boot  etc  lib   media       opt  root  selinux  sys  usr
        

      Clean Up after Your Download

      After you’ve finished downloading your files or disks, you can optionally delete the restored disks. If you created a new Linode to perform the restore, consider deleting the Linode. As a reminder, billing for that Linode will continue automatically if you do not remove it. If you only power the Linode off, you will still be billed for it.

      Join our Community

      Find answers, ask questions, and help others.

      This guide is published under a CC BY-ND 4.0 license.



      Source link

      SMF Create a backup


      When you administrate a website it is very important to guarantee that the content is safe and sound no matter of the circumstances. This is even more important when it comes to data submitted from the members of your discussion board.

      In order to ensure nothing would be lost or mistakenly deleted you should always keep a local copy of your SMF board, so if anything unexpected happen.

      In this section of our tutorial we will show you how to create backup of your platform.

      Actually this is a straightforward process which can be performed in two simple steps.

      The first one is to create a copy of the application files and download them on your local computer. In case that you are not sure how to do that yourself you can check this article.

      The other step is to generate a MySQL dump file of your database. This actually is a copy of the database associated with your website. To create such dump file you can follow the instructions we have provided here.

      The post SMF Create a backup appeared first on TMDHosting.



      Source link