How to Import or Export Existing Repositories
Reviewed in August 2023
If you have an existing Borg repository, you can import it into BorgBase using SFTP. Naturally you can use the same technique to export an existing repository.
Import Existing Repository
Section titled “Import Existing Repository”First, create a new and empty BorgBase repository in your account under Repositories > New Repo. Choose the name, region and assign a SSH key for access. Then open the Advanced Options section and Enable SFTP. Finally, click Add Repository to actually create the repository.
Next click the Copy repo URL button on the left of the table row. This will add the address of your new repo to the clipboard.
Then on your local system, navigate into the existing repository to be uploaded. The folder should have files called config and data. After ensuring you are in the correct folder, connect to your new BorgBase repository with sftp:
$ sftp xxxxxxx@xxxxxxx.repo.borgbase.com:repoIf the connection succeeds, you will see a new prompt starting with sftp>. Now you can upload all existing data with put -Rp .:
sftp> put -Rp .After the copy operation is finished, you can change your repo’s access mode back to Borg and use borg info to verify the new repo.
Export Existing Repository
Section titled “Export Existing Repository”Exporting works similar to importing, but assumes that you already have the repository set up in BorgBase. To export it, open the Repositories page in the web interface and choose the Edit icon in the right column. This will open the repository settings.
Then open the Advanced Options section and Enable SFTP. When done, click Save Changes and copy the repo URL to the clipboard (icon on the left side)
Next connect to your existing repo using sftp:
$ sftp xxxxxxx@xxxxxxx.repo.borgbase.com:repoAnd download the repo folder:
sftp> get -Rp .Using Rclone
Section titled “Using Rclone”rclone is a bit more complex but offers good sync features. This makes it better suited for larger repos. Example config (find config path via rclone config file):
[borgbase]type = sftphost = xxx999.repo.borgbase.comuser = xxx999key_file = ~/.ssh/id_ed25519shell_type = unixmd5sum_command = nonesha1sum_command = noneTo upload a repository to BorgBase:
$ rclone sync -v local-repo borgbase:repoTo download a repository from BorgBase:
$ rclone sync -v borgbase:repo local-repo