Bulk create clients

I have over 200 clients I need to add to UrBackup, but they are on a different subnet than the server so I can’t scan for them. If I have a .csv or list of the computer names can I bulk add them to UrBackup in some way? I do not see bulk create/import in the documentation.

If you install them simultaneously perhaps https://installercreator.urbackup.org/ , but that is mentioned in the manual.

Other than that perhaps using the Python API GitHub - uroni/urbackup-server-python-web-api-wrapper: Python wrapper to access and control an UrBackup server (or JavaScript). But then you have the problem of getting the authkey to the clients somehow?

Helpful AI (it is urbackup_api.urbackup_server though):

Funny enough I asked it the same thing and it replied:

CSV Import: If you have a list of clients that you want to add to UrBackup, you can use the CSV import feature. This feature allows you to import a CSV file containing client information, such as the client name, IP address, and operating system. You can access this feature by going to the “Settings” page in the UrBackup web interface and selecting “Import”.

Here is the code it generated for adding IPs to discover clients :smiley:

import csv
import urbackup_api

# Open the CSV file and read the IPs
with open('ip_list.csv', 'r') as csv_file:
    csv_reader = csv.reader(csv_file)
    ips = [row[0] for row in csv_reader]

# Connect to the UrBackup server
server = urbackup_api.urbackup_server('http://urbackup-server:55414/x', 'username', 'password')

# Add each IP to the UrBackup server
for ip in ips:
    server.add_extra_client(ip)

Edit: Corrected the urbackup_api.urbackup_server

When you use the API to add clients is it the same as using the web UI “Add new client” button under Status? That is, would I then be able to generate a unique .exe per client after importing the .csv of client names? And, is there a way to use the API to generate unique installers per client in bulk?

I wanted to reply and thank you for the API. I’ve never written much Python but a few hours I was able to create two scripts, one that adds clients from a CSV and a second that downloads all Windows installers. Especially thankful for the examples: urbackup-server-python-web-api-wrapper/urbackup_api_test.py at 2f9c6697ccd72da35d79a77ffd2fa65019ebebd5 · uroni/urbackup-server-python-web-api-wrapper · GitHub

To address my previous question yes clients added through the API are just like being added through the web UI, at least from what I can tell. And there is a way to bulk download client installers using the API.

Create clients from CSV

import csv
import urbackup_api

server = "http://urbackup.example.com:55414/x"
username = "my_username"
password = "my_password"

urbackupClient = urbackup_api.urbackup_server(server, username, password)

with open('Clients.csv', newline='') as csvfile:
    reader = csv.reader(csvfile)
    for row in reader:
        clientName = row [0]
        urbackupClient.add_client(clientName)

Download all client installers from Clients.csv

import csv
import urbackup_api
from urbackup_api import installer_os

server = "http://urbackup.example.com:55414/x"
username = "my_username"
password = "my_password"

urbackupClient = urbackup_api.urbackup_server(server, username, password)

with open('Clients.csv', newline='') as csvfile:
    reader = csv.reader(csvfile)
    for row in reader:
        clientName = row [0]
        urbackupClient.download_installer(clientName + ".exe", clientName, installer_os.Windows)