Backup Procedures

From 24PinTech Wiki
Jump to navigation Jump to search

How to back up Fenrir(10.21.25.3) and Friia (10.21.25.4) manually

This is how we back up our two Windows servers to an external drive.

  1. Get the external drive labelled "server backups" from the middle drawer on the left of chamberlains desk.
  2. Take the drive into the back room and remove the guard on the server labelled Valhalla and plug the drive into the right USB port.
  3. On a computer in the classroom use chrome and type "10.21.25.2" into the address bar. The log in for ESXI is the same for your log in for class. (Server Admin accounts only)
  4. Go to virtual machines and click on "Odin" click on "Edit" and click on "Add other device" and then "USB device" select Western Digital My Passport 25E2. Press save and click on the window of the virtual machine to be taken to Odins desktop.
  5. Click on "Actions" and then "Guest OS" "Send Keys" and "ctrl-alt-del" and log in using your profile in class. (Server Admin accounts only)
  6. Use the start menu and type "Windows Server Backup" open it.
  7. The Snap-in on the left has the option to to perform "Local Backup" the snap in on the right has an option to backup select it and go through the menu that pops up and select the following options "Backup Once, Different options, Full server, local drive select "my passport" and hit backup.
  8. After backup is finished go back to 10.21.25.2 and click on Odin then "Edit" and press the small x next to the hard drive. Put the hard drive in chamberlains desk when you are finished.
  9. For Friia do the exact same process.

Automated Backups

The following command will create a Task Scheduler task named WeeklySystemStateBackup that runs every Saturday ( SAT ) at 19:00 (7 pm). This task will run WEEKLY with the HIGHEST privileges. It will run the Windows Server Backup CLI to backup SYSTEMSTATEBACKUP to target volume "E" (Volume E is a physical hard drive in the back on the server called "my passport")

Schtasks /Create /SC weekly /D SAT /TN WeeklySystemsStateBackup /ST 19:00 /TR “wbadmin start systemstatebackup -backupTarget: E:”

This can also be ran manually via the task scheduler.

Restore Windows Server Backup on ESXi

The following process was used to restore a backup of our production server Odin which is a active directory server with DNS, DHCP, Print, and other services. In the process you will have to use DRSM (Directory Service Restore Mode) if you are trying to restore a server running Active Directory because if you try in normal Windows mode you'll encounter an error. The restored version of the VM may encounter some errors you may have to fix but it should sort itself out. This may be just because you are restoring an older machine so whatever it's running that's synced may get confused. The following steps guide you through this process:

  1. Grab a backup of the Windows Server you are trying to restore
  2. Go to one of our ESXi machines and create a new VM with the necessary requirements for the machine you want to restore. In our case we are trying to restore a Windows Server 2019 Domain Controller so we gave it 100 GB of storage, 4 CPUs, and 8 GB of memory.
  3. Do basic setup of the machine and once it is installed you want to add the Windows Server Backup Feature
  4. Once done you have to boot the Server back into Directory Service Restore Mode (A type of safe mode.) To do this run msconfig by either right clicking the start menu or doing Win+R.
  5. Go over to the Boot Tab and check the following two checks, Safe mode and DSRM (Directory Service Restore Mode.) Follow the prompt and restart the computer.
  6. Once the computer has booted into DRSM open Windows Server Backup and run the restore command.
  7. Follow the prompts depending on where your backup is stored and what server you are trying to restore.
  8. When asked what files you want to restore, do System State if you are trying to restore an entire machine or one of the other options if you are trying to restore certain files.
  9. Go ahead and check the Active Directory Replication check mark and continue on.
  10. The restoration process should start and once done the computer will have to restart, it will restart into DRSM. You’ll have to go back into msconfig and uncheck the safe mode option and restart the computer again.
  11. The computer should reboot into the restored version of the machine, there may be some errors or active directory issues but those should sort themselves out. This is just because you are restoring an older version of a machine and the active directory is confused.  

How to back up Logan_Web (10.21.25.11) Manually

Step One; The first and most essential step to backing up Logan_Web onto the Fog server is to register it to the Fog server itself, in order to be able to perform the process. If not already completed, this can be performed by doing a full host registration. Begin this by logging into the Fog server (http://10.21.25.29/fog) and selecting the 'Images' tab. Create a new image, and name it accordingly to what is required. Once completed, you're going to find Logan and select it. Before booting into the device, make sure to head into the 'Actions' tab near the top and choose to Edit settings. On the first tab, the Virtual Hardware, make sure that the ability to connect with the NIC is available; as this is how we'll be PXI booting. Then, head into the VM settings and expand the 'Boot Options' category. Scroll for just a moment and select the option to force the device to boot into BIOS. Once accomplished, go into the boot settings of the BIOS and move 'Ethernet' to the top of the list. Continue the booting process, and do not forget to rearrange the Boot Order at a later date. Once you are prompted with a menu, select 'Full Host Registration'

Hostname: Dev_Logan

logging into the Fog server (http://10.21.25.29/fog) and selecting the 'Hosts' tab. Search this list of servers for 'dev_logan', as this is the server we're going to be backing up. Select the 'Capture' option on 'dev_logan', and once completed, the next time that Logan is PXI booted through ethernet it'll be automatically pulled and backed up.

Step Two; Once this request to pull the image from Logan has gone through, the next step is to boot into Logan to perform the backup. Head to https://10.21.25.8/ui/#/login and logon to the ESXi device. Once completed, you're going to find Logan again and select it. Before booting into the device, make sure to head into the 'Actions' tab near the top and choose to Edit settings. On the first tab, the Virtual Hardware, make sure that the ability to connect with the NIC is available; as this is how we'll be PXI booting. Then, head into the VM settings and expand the 'Boot Options' category. Scroll for just a moment and select the option to force the device to boot into BIOS.

Step Three; When ready

Step Two; Once the request has been sent over and has gone through, you'll need to pull the image from the Fog server onto Logan. This can be done by 'Pxi Booting', as in, taking it off of the network by booting from Ethernet. By doing this, you'll be initiating the booting process in such a way that the image will begin its installation. You can 'Pxi Boot' a system by going into the boot menu while the device is starting up, and selecting the Ethernet option. The actual process of this may be more complicated, and you can get more insight into it *here*. (Possibly hyperlink to another article if existing, if not then write a short section on it here.)

Step Three; Coming to the end now, the final step in your process will be to store the image you've just used in the UnRAID Server, for future usage and documentation. This can be done by first logging into the UnRAID server and then navigating your way to

Step Four; Verify full system functionality as any good technician in 24PinTech should, and then your task should be complete.

How to back up Fog images (automatic)

Installing rsync

Access fog and log into the console with the admin account. Open the terminal and run the following command to install rsync. We need to run this command as sudo to grant the user the same security privileges as the superuser.

sudo apt install rsync

Checking/creating ssh keys

To automate these backups, we need to be able to login without a password by creating ssh keys. First, you should check if these already keys exist using the following command.

ls -al ~/.ssh/id_*.pub

If the keys don't exist, they should be created using the following command. When prompted for a password press enter to set it to no password.

ssh -keygen -t rsa

This key also needs to be on the destination so the key should be copied to Midgard using the following command.

ssh-copy-id -i ~/.ssh/id_rsa.pub [/cdn-cgi/l/email-protection [email protected]]

Automatic backups

To automate backups, we need to use cron and create a cronjob.

crontab -e

We want it to run once a month so we will set beginning part of the command to run monthly. The first number represents the minute, second is hour, third is day, fourth is month, and fifth is day of the week. We also need to add the rsync command after to backup up the fog images to the backups folder on Midgard. This will now backup the fog images at the beginning of every month.

0 0 1 * * rsync -e 'ssh -p 22' -avp /images/ 10.21.25.13:/mnt/user0/Backups/Fog_Images/

Old manual back up procedures

Server Backup Information

This process will be followed every week we are in session to make sure that all of our backups are properly configured. With our current NAS setup, we have created a script that run every week that schedules weekly backups. Backups will start at 9pm on their set day of the week.

Schedule

Server Backups only happen once a week at 9:00PM

Monday - Loki

Tuesday - Logan

Wednesday - Surtr

Thursday - freyr ===Server Folder Names (NAS Server) ===*Loki - LOKI_Backup

  • Logan - LOGAN_Backup
  • surtr - SURTR_Backup
  • freyr - freyr_Backup

Creating Backups

Remote desktop into the server you need to backup.*Loki - 10.21.25.3

  • Surtr - 10.21.25.2
  • freyr - 10.21.25.5

Backup steps:

  1. To use remote desktop click the windows button and search, or use windows + r and run mstsc.exe.
  2. On the server manager, click tools and search for Windows Server Backup. (if it's not there you may need to install the feature.)
  3. Once opened, click backup schedule and then make a new backup schedule, and click next.
  4. We back up the servers to the NAS Server so you need to set the backup location to \\10.21.25.16\(ServerShareFolderName).
  5. Continue through setup and complete backup.
  6. Check throughout the day to make sure the scheduled backup is working properly.

Restoration

This is the process to restore from a backup. Windows Server must be able to boot and access the backup program. You can reinstall Windows Server and then use the backup program on the new install to restore.

  1. Open Windows Server Backup and click "Recover..." on the right pane.
  2. Choose the option for "A backup stored on another location" and click next. Then choose shared folder.
  3. Type in the location of the backup, which is \\10.21.25.16\(ServerFolderNameHere) to find the folder name go to the NAS configuration web interface or use another computer to access the NAS in file explorer to view folders.
  4. Select the latest backup date where the server was working properly.
  5. Then choose what type of recovery you want, then click next. Then choose specific items to recover from within the recovery type, and click next again.
  6. Specify your final recovery options, which will depend on which type of recovery and what items you want to recover.
  7. Confirm, and ensure the recovery worked properly by ensuring full system functionality.

Cannot find specified route

If Windows Server Backup gives you an error about the backup not being able to reach the specified remote folder, it means the NAS has disconnected from the NAS server and needs to be reconnected to Active Directory.

Solution:

  1. Login to the NAS by going to 10.21.25.16 in a browser, and logging in as an admin.
  2. Navigate the options at the top until you find the settings button.
  3. Go to the network tab on the left, and then scroll down to Windows Services.
  4. Click the configure link next to the Active Directory on switch. The login is install, install and use CISCOACA.local as the domain name. 10.21.25.3 is the DNS server. Make sure the Active Directory switch is on. Make sure it says connected to CISCOACA.local underneath it.
  5. Try the backup again.