From 951b85d6201e4ba61fa544b8c8e2d7e495f93886 Mon Sep 17 00:00:00 2001 From: Christoph Dyllick-Brenzinger Date: Tue, 28 Oct 2025 12:53:00 +0100 Subject: [PATCH] update base export --- .../configuration/authentication/saml-team.md | 4 +- docs/maintenance/base-export.md | 90 +++++++++-- docs/maintenance/helper-scripts.md | 140 ++++++++++-------- 3 files changed, 153 insertions(+), 81 deletions(-) diff --git a/docs/configuration/authentication/saml-team.md b/docs/configuration/authentication/saml-team.md index 58d9b2511..ada5aa3ba 100644 --- a/docs/configuration/authentication/saml-team.md +++ b/docs/configuration/authentication/saml-team.md @@ -1,7 +1,7 @@ --- status: wip -search: - exclude: true +#search: +# exclude: true --- # SAML Authentication (for multi-tenancy environments) diff --git a/docs/maintenance/base-export.md b/docs/maintenance/base-export.md index 7022fb196..21297788d 100644 --- a/docs/maintenance/base-export.md +++ b/docs/maintenance/base-export.md @@ -4,39 +4,101 @@ status: wip # Exporting a Base from the Command Line -SeaTable allows you to export a base using the command line, bypassing typical limitations from the web interface. +SeaTable provides two ways to export a base using the command line. You can perform a simple export to a single `.dtable` file or an advanced export that includes all data, including big data content. Both methods bypass the limits of the web interface. -!!! warning "Big Data Exclusion" +## Simple Export: Create a .dtable File - Please note that the base export does not include big data. +The simple export generates a ready-to-use `.dtable` file that can be imported into another SeaTable instance. -## Export Command +### Advantages -Use the following command to export a base by its `base_uuid`. The dtable file will be saved to the `/templates` folder inside the docker container. +- Easy to run and import +- Produces a single `.dtable` file -``` +### Limitations + +- Maximum export size: 100 MB +- Does not include big data content from the SeaTable Big Data backend + +### Export command + +Use the following command to export a base by its `base_uuid`. The `.dtable` file will be saved to your current directory. In this example, the `/shared` folder is used because it is accessible from the SeaTable host. + +```bash docker exec -it seatable-server bash -cd /templates +cd /shared seatable.sh python-env /opt/seatable/seatable-server-latest/dtable-web/manage.py export_dtable ``` -Replace `` with the actual UUID of the base. +Replace `` with your actual base UUID. -## Exporting Without Assets +### Excluding Attached Files and Images -By default, the export includes all data and content from image and file columns. To exclude file/image columns and export only base data, use the `--ignore-asset` parameter: +To export only the structured base data and omit all assets (images, files), use the `--ignore-asset` option: ``` seatable.sh python-env /opt/seatable/seatable-server-latest/dtable-web/manage.py export_dtable --ignore-asset true ``` -## Troubleshooting Large Asset Exports +### If the Export Fails Due to Size Limits -If your base contains numerous assets, SeaTable may refuse to export with assets included. To resolve this, increase the `max_download_dir_size` value in the `seafile.conf` file and [restart SeaTable](../maintenance/restart-seatable.md): +If your base contains many attached files/images, you might encounter the `max_download_dir_size` limitation. You can increase this limit (default is 100 MB) in `seafile.conf`: -``` +```ini [fileserver] max_download_dir_size=1000 ``` -This adjustment allows the creation of dtable files up to 1 GB in size. +Then [restart SeaTable](../maintenance/restart-seatable.md) +This allows `.dtable` exports up to 1 GB in size. + +## Advanced Export: Export to a Folder with All Data + + + +The advanced export uses the `export_dtable_folder` command. It creates a local folder that contains all base data, assets, and big data content. This approach is ideal for complete backups or when moving large datasets. + +### Advantages + +- Includes data from the Big Data backend +- No size limitation (overcomes the 100 MB default limit) + +### Limitations + +- The export produces a folder structure, not a single `.dtable` file +- Requires manual handling when re-importing or transferring + +### Export Command + +Run the following command to export all content, including big data, to your current folder. In this example, the `/shared` folder is used because it is accessible from the SeaTable host. + +```bash +docker exec -it seatable-server bash +cd /shared +seatable.sh python-env /opt/seatable/seatable-server-latest/dtable-web/manage.py export_dtable_folder +``` + +This command creates: + +- a folder with the name of the base +- inside this folder: + - a content.json file with the base’s structure and data + - one or more subfolders for assets and big data files + +### Optional parameters + +- `--ignore-archive-backup true`: Skips the export of archived backup data. Use this if archived backups are not required in the exported result. + +## Importing an Advanced Export + + + +To import an exported base folder into another group/workspace, use the following command. + +```bash +seatable.sh python-env /opt/seatable/seatable-server-latest/dtable-web/manage.py import_dtable_folder --workspace-id="" --path="" +``` + +Replace `` with the ID of the target workspace/group and provide the path to the folder containing the export. + +After running the command, check that the output indicates a successful import. \ No newline at end of file diff --git a/docs/maintenance/helper-scripts.md b/docs/maintenance/helper-scripts.md index 548766d56..5ab25a16f 100644 --- a/docs/maintenance/helper-scripts.md +++ b/docs/maintenance/helper-scripts.md @@ -13,67 +13,73 @@ After installing SeaTable, `/opt/seatable-compose/tools` contains the following This script allows you to enable an **existing** SeaTable user inside the database. Simply provide the user's contact email address as a parameter: -```bash -./tools/activate-user.sh "user@email.com" -``` +=== "Input" -**Output** + ```bash + ./tools/activate-user.sh "user@email.com" + ``` -``` --------------- -UPDATE ccnet_db.EmailUser SET is_active = 1 WHERE email = (SELECT user FROM dtable_db.profile_profile WHERE contact_email = 'user@email.com') --------------- +=== "Output" -Query OK, 1 row affected (0.002 sec) -Rows matched: 1 Changed: 1 Warnings: 0 + ``` + -------------- + UPDATE ccnet_db.EmailUser SET is_active = 1 WHERE email = (SELECT user FROM dtable_db.profile_profile WHERE contact_email = 'user@email.com') + -------------- -Bye -Success: Activated user user@email.com -``` + Query OK, 1 row affected (0.002 sec) + Rows matched: 1 Changed: 1 Warnings: 0 + + Bye + Success: Activated user user@email.com + ``` ### deactivate-user.sh This script allows you to disable an existing SeaTable user inside the database. Simply provide the user's email address as a parameter: -```bash -./tools/deactivate-user.sh "user@email.com" -``` +=== "Input" + + ```bash + ./tools/deactivate-user.sh "user@email.com" + ``` -**Output** +=== "Output" -``` --------------- -UPDATE ccnet_db.EmailUser SET is_active = 0 WHERE email = (SELECT user FROM dtable_db.profile_profile WHERE contact_email = 'user@email.com') --------------- + ``` + -------------- + UPDATE ccnet_db.EmailUser SET is_active = 0 WHERE email = (SELECT user FROM dtable_db.profile_profile WHERE contact_email = 'user@email.com') + -------------- -Query OK, 1 row affected (0.002 sec) -Rows matched: 1 Changed: 1 Warnings: 0 + Query OK, 1 row affected (0.002 sec) + Rows matched: 1 Changed: 1 Warnings: 0 -Bye -Success: Deactivated user user@email.com -``` + Bye + Success: Deactivated user user@email.com + ``` ### user-stats.sh This script will print your current license limit and query the database for the number of enabled users: -```bash -./tools/user-stats.sh -``` +=== "Input" + + ```bash + ./tools/user-stats.sh + ``` -**Output** +=== "Output" -``` -User limit according to license file: 3 + ``` + User limit according to license file: 3 -Users in database: -+-------+--------------+ -| users | active_users | -+-------+--------------+ -| 2 | 2 | -+-------+--------------+ -``` + Users in database: + +-------+--------------+ + | users | active_users | + +-------+--------------+ + | 2 | 2 | + +-------+--------------+ + ``` ## Database management @@ -81,44 +87,48 @@ Users in database: This script will give you an interactive shell inside the MariaDB container. You can use this to directly run SQL commands. -```bash -./tools/db-shell.sh -``` +=== "Input" -**Output** + ```bash + ./tools/db-shell.sh + ``` -``` -Welcome to the MariaDB monitor. Commands end with ; or \g. -Your MariaDB connection id is 73 -Server version: 11.4.3-MariaDB-ubu2404 mariadb.org binary distribution +=== "Output" -Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. + ``` + Welcome to the MariaDB monitor. Commands end with ; or \g. + Your MariaDB connection id is 73 + Server version: 11.4.3-MariaDB-ubu2404 mariadb.org binary distribution -Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. + Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. -MariaDB [(none)]> -``` + Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. + + MariaDB [(none)]> + ``` ### dump-database.sh This script will dump all three databases (`ccnet_db`, `dtable_db` and `seahub_db`) to `/opt/seatable-backup` on the host. -```bash -./tools/dump-database.sh -``` +=== "Input" + + ```bash + ./tools/dump-database.sh + ``` -**Output** +=== "Output" -``` -Success: Dumped databases into /opt/seatable-backup -``` + ``` + Success: Dumped databases into /opt/seatable-backup + ``` -**Created Files** +=== "Created Files" -``` -total 228 --rw-r--r-- 1 root root 12184 May 23 11:30 ccnet_db-2025-05-23-11-30-27.sql --rw-r--r-- 1 root root 177499 May 23 11:30 dtable_db-2025-05-23-11-30-27.sql --rw-r--r-- 1 root root 38402 May 23 11:30 seafile_db-2025-05-23-11-30-27.sql -``` + ``` + total 228 + -rw-r--r-- 1 root root 12184 May 23 11:30 ccnet_db-2025-05-23-11-30-27.sql + -rw-r--r-- 1 root root 177499 May 23 11:30 dtable_db-2025-05-23-11-30-27.sql + -rw-r--r-- 1 root root 38402 May 23 11:30 seafile_db-2025-05-23-11-30-27.sql + ```