# Transferring server data between two dedicated systems - Wget & Python3

<span style="color: rgb(0, 0, 0);">The easiest way to transfer a tarball or zip file from one dedicated system to another is by using wget and a python3 webserver, protected from sending out the data from UFW allow in only that IP address or using the internal network if your system has it, such as OVH's vSwitch/vRack system.</span>

<span style="color: rgb(0, 0, 0);">Open up SSH. In this example, we will be using Pterodactyl's UUID's in the volumes folder, but this also applies to any zip/tarball you want to do this on such as servers stored in /home or /srv.</span>

<span style="color: rgb(0, 0, 0);">Go to `cd /var/lib/pterodactyl/volumes` and then do `ls` to see the containers.</span>

<span style="color: rgb(0, 0, 0);">[![image.png](https://docs.jasmeow.systems/uploads/images/gallery/2023-07/scaled-1680-/cf74gzeURhMtnqOy-image.png)](https://docs.jasmeow.systems/uploads/images/gallery/2023-07/cf74gzeURhMtnqOy-image.png)</span>

<span style="color: rgb(0, 0, 0);">We will use "031d5..." as an example. Run `tar -zcvf SERVERNAME.tgz 031d5` then press tab to autofill the entire server ID.</span>

<span style="color: rgb(0, 0, 0);">[![image.png](https://docs.jasmeow.systems/uploads/images/gallery/2023-07/scaled-1680-/OfJGsUCQpDnu1pao-image.png)](https://docs.jasmeow.systems/uploads/images/gallery/2023-07/OfJGsUCQpDnu1pao-image.png)</span>

<span style="color: rgb(0, 0, 0);">Let it finish tarballing. You'll know when it's finished as the output stops showing you what files it's archived and goes back to the normal terminal line waiting input.</span>

<span style="color: rgb(0, 0, 0);">[![image.png](https://docs.jasmeow.systems/uploads/images/gallery/2023-07/scaled-1680-/QSdkXS9u2tn68c4Z-image.png)](https://docs.jasmeow.systems/uploads/images/gallery/2023-07/QSdkXS9u2tn68c4Z-image.png)</span>

<span style="color: rgb(0, 0, 0);">Do `ip a` on your destination system and find the public IP. Remember, some systems have internal networking so you might be able to do "`wget 10.10.10.1:8000/hub.tgz`" for example instead of the public IP and whitelisting it, as it normally is already whitelisted. </span>

<span style="color: rgb(0, 0, 0);">![](https://jasmeow.pics/eFyVpA.png)</span>

<span style="color: rgb(0, 0, 0);">Once you've found either the public or the private IP, go back onto your source system and type `ufw allow from x.x.x.x` changing the x's to your IP.</span>

<span style="color: rgb(0, 0, 0);">![](https://jasmeow.pics/uWV0tX.png)</span>

<span style="color: rgb(0, 0, 0);">You can now type `ip a` on your source system to get its IP you need.</span>

<span style="color: rgb(0, 0, 0);">![](https://jasmeow.pics/kpMDWw.png)</span>

<span style="color: rgb(0, 0, 0);">On your source system, now type `python3 -m http.server` to start up a temporary HTTP server on port 8000 for WGet to pull from. If the port is already in use and errors out, type the port after the command, as shown below.</span>

<span style="color: rgb(0, 0, 0);">[![](https://jasmeow.pics/9BaTof.png) ](https://docs.jasmeow.systems/uploads/images/gallery/2023-07/m5mAQZmARsOrD3jX-image.png)[![image.png](https://docs.jasmeow.systems/uploads/images/gallery/2023-07/scaled-1680-/EJVS7baTjpbZ9T1Q-image.png)](https://docs.jasmeow.systems/uploads/images/gallery/2023-07/EJVS7baTjpbZ9T1Q-image.png)</span>

<span style="color: rgb(0, 0, 0);">Go to your destination system and go to a folder you want to import into, such as making a directory called /import then going into it. Run `wget x.x.x.x:PORT/FILENAME.tgz`, replacing the x's with your public or private IP, the PORT with the port it opened and the FILENAME with the tarball name.</span>

<span style="color: rgb(0, 0, 0);">![](https://jasmeow.pics/wAChY5.png)</span>

<span style="color: rgb(0, 0, 0);">You will see a progress bar with it transferring over. Once it's done, it will go back to the normal terminal line.</span>

<span style="color: rgb(0, 0, 0);">![](https://jasmeow.pics/yM8ldX.png)</span>

<span style="color: rgb(0, 0, 0);">You can now go back to the source system and "Ctrl + C" to exit out of the webserver.</span>

<span style="color: rgb(0, 0, 0);">[![image.png](https://docs.jasmeow.systems/uploads/images/gallery/2023-07/scaled-1680-/vLJSKg5QXpTISBAc-image.png)](https://docs.jasmeow.systems/uploads/images/gallery/2023-07/vLJSKg5QXpTISBAc-image.png)</span>

<span style="color: rgb(0, 0, 0);">On your destination system, you can now do what you need to do on your tarball, such as move it to another place, extract it with `tar -xvf FILENAME.tgz` and more.</span>

[![image.png](https://docs.jasmeow.systems/uploads/images/gallery/2023-07/scaled-1680-/ZxdwL4ZpWuorrz2s-image.png)](https://docs.jasmeow.systems/uploads/images/gallery/2023-07/ZxdwL4ZpWuorrz2s-image.png)

<span style="color: rgb(0, 0, 0);">If the transfer was successful and the extraction also was successful, make sure you go onto the old source system and delete the old tarball, you don't want to fill up on disk space.</span>

[![image.png](https://docs.jasmeow.systems/uploads/images/gallery/2023-07/scaled-1680-/oRC04WJ3deb0xog0-image.png)](https://docs.jasmeow.systems/uploads/images/gallery/2023-07/oRC04WJ3deb0xog0-image.png)