eShare Backup Restore tool

You can backup and restore Cadmatic eShare server, server and project databases, server configuration files, and individual eShare projects using eShare Backup Restore tool from the command line by running it as an administrator. The eShareBackupRestore.exe is located in Program Files\Cadmatic\eShareAdminTools\eShareBackupRestore.

Any files referenced by data sources are not owned by eShare and they are not included in the backups.

Note: Running the tool stops eShare server and restarts it again after the tool has finished running.

 

Prerequisites

  • Cadmatic eShare server must have appropriate permissions in the database. It should be able to create, delete, and rename databases, and also be able to insert, update, delete, and select data in the database tables. See Required permissions for eShare Backup Restore tool.

Do the following:

Run the tool from the command line without any options to display usage information.

eShareBackupRestore

Project backup

Perform the following to create a backup of Cadmatic eShare project.

eShareBackupRestore backupproject <option>

Required options

Description

-u

--url

eShare server's URL

-d

--directory

directory where to store the backup file

-p

--project

name of the project to backup

Optional options

Description

--pointclouds

flag which specifies whether to backup point clouds and textured meshes

--force

flag which specifies whether to not ask for confirmation before proceeding with the backup

--loglevel

sets the logging level: Trace, Debug, Information, Warning, Error, or Critical. Default level is Information.

--help

show help and usage information

Examples

To run a command, you need to know the URI of the Cadmatic eShare server. In the examples below the server address and port is localhost:81.

  • Creates a backup of the project:

    eShareBackupRestore backupproject -u http://localhost:81 -p DemoProject -d c:\temp\

  • Creates a backup of the project, including point clouds and textured meshes:

    eShareBackupRestore backupproject -u http://localhost:81 -p DemoProject -d c:\temp\ --pointclouds

  • Creates a backup of the project without asking for confirmation:

    eShareBackupRestore backupproject -u http://localhost:81 -p DemoProject -d c:\temp\ --force

Server backup

Perform the following to create a backup of Cadmatic eShare server.

eShareBackupRestore backupserver <option>

Required options

Description

-u

--url

eShare server's URL

-d

--directory

directory where to store the backup file

Optional options

Description

--pointclouds

flag which specifies whether to backup point clouds and textured meshes

--force

flag which specifies whether to not ask for confirmation before proceeding with the backup

--loglevel

sets the logging level: Trace, Debug, Information, Warning, Error, or Critical. Default level is Information.

--help

show help and usage instructions

Examples

To run a command, you need to know the URI of the Cadmatic eShare server. In the examples below the server address and port is localhost:81.

  • Creates a backup of the server:

    eShareBackupRestore backupserver -u http://localhost:81 -d c:\temp\

  • Creates a backup of the server, including point clouds and textured meshes:

    eShareBackupRestore backupserver -u http://localhost:81 -d c:\temp\ --pointclouds

  • Creates a backup of the server without asking for confirmation:

    eShareBackupRestore backupserver -u http://localhost:81 -d c:\temp\ --force

Restoring eShare project from backup

Perform the following to restore a Cadmatic eShare project from backup.

eShareBackupRestore restoreproject <option>

Required options

Description

-u

--url

eShare server's URL

-f

--file

the backup file to restore from

-p

--project

Original name of the project to restore if the backup file contains multiple projects. If the file contains only one project this is not needed.

Optional options

Description

--newdb

renames the project database

If another database with the name already exists, it will not be overwritten

--force

flag which specifies whether to not ask for confirmation before proceeding with the restore

-c

--connectionstring

can be used to override the IIS connection string

--loglevel

sets the logging level: Trace, Debug, Information, Warning, Error, or Critical. Default level is Information.

--map-users

maps each user the backup refers to onto the target server account with the same login, when the account IDs differ. Use this when moving a project between servers that have the same users under different account IDs. See Mapping users.

--user-map-file <path>

maps users by the pairs listed in a JSON file. Use it when logins differ between the servers. Used alone, it maps only the pairs in the file. Add --map-users to match the rest by login. See Mapping users.

--help

show help and usage information

Mapping users

Each key in the mapping file is a user from the backup, written as a login or an account ID. Each value is a login on the target server. Example of the mapping file:

Copy
{
"jdoe@example.com": "john.doe",
"3f2504e0-4f89-11d3-9a0c-0305e82c3301": "jane.doe"
}

Notes:

  • Logins are matched case-insensitively.

  • When both options (--map-users and --user-map-file) are used, the pairs in the file win over automatic matches.

  • Each target account can receive only one user. If two users from the backup map to the same account, the restore stops and lists the conflicting pairs.

  • A backup taken before 2026H2 only knows the users who had a permission on the project. Server administrators and users who got access through a group can only be mapped by account ID in the mapping file. The restore warns about this. Taking a new backup on an up-to-date server removes the limitation.

Examples

To run a command, you need to know the URI of the Cadmatic eShare server. In the examples below the server address and port is localhost:81.

  • Restores the project from backup, when there is only one project in the backup file:

    eShareBackupRestore restoreproject -u http://localhost:81 -f c:\temp\eShareServer_DemoProject_2024T1R4_2024-04-04-123456.7z

  • Restores the project from backup when there are multiple projects in the backup file:

    eShareBackupRestore restoreproject -u http://localhost:81 -f c:\temp\EShareProject_DemoProject_2024T1R4_2024-04-04-123456.7z -p DemoProject

  • Restores the project from backup and renames the project database with a new name:

    eShareBackupRestore restoreproject -u http://localhost:81 -f c:\temp\EShareProject_DemoProject_2024T1R4_2024-04-04-123456.7z --newdb DemoProjectDatabase

  • Restores the project from backup and overrides the IIS connection string:

    eShareBackupRestore.exe restoreproject -u http://localhost:81 -f c:\temp\EShareProject_DemoProject_2024T1R4_2024-04-04-123456.7z -c "server=localhost;initial catalog=EShare; uid=sa; pwd=PassWd123;"

Restoring eShare server from backup

Perform the following to restore Cadmatic eShare server from backup.

eShareBackupRestore restoreserver <option>

Required options

Description

-u

--url

eShare server's URL

-f

--file

the backup file to restore from

Optional options

Description

--configs

flag which specifies whether to restore the server's configuration files

These files are AppSettings.config, ConnectionStrings.config, and Web.config in the installation directory of eShare server, and NLog.config in the bin folder of the installation directory of eShare server.

-c

--connectionstring

can be used to override the IIS connection string

--force

flag which specifies whether to not ask for confirmation before proceeding with the restore

--loglevel

sets the logging level: Trace, Debug, Information, Warning, Error, or Critical. Default level is Information.

--help

show help and usage information

Examples

To run a command, you need to know the URI of the Cadmatic eShare server. In the examples below the server address and port is localhost:81.

  • Restores the server from backup:

    eShareBackupRestore restoreserver -u http://localhost:81 -f c:\temp\EShareServer_2024T1R4_2024-04-04-123456.7z

  • Restores the server from backup, including the server's configuration files:

    eShareBackupRestore restoreserver -u http://localhost:81 -f c:\temp\EShareServer_2024T1R4_2024-04-04-123456.7z --configs

  • Restores the server from backup without asking for confirmation:

    eShareBackupRestore restoreserver -u http://localhost:81 -f c:\temp\EShareServer_2024T1R4_2024-04-04-123456.7z --force

  • Restores the server from backup and overrides IIS connection string:

    eShareBackupRestore restoreserver -u http://localhost:81 -f c:\temp\EShareServer_2024T1R4_2024-04-04-123456.7z -c "server=localhost;initial catalog=EShare; uid=sa; pwd=PassWd123;"