Skip to content

Importing Exporting Data to from Civilizer

suewonjp edited this page Mar 18, 2017 · 9 revisions

βœ”οΈ Exporting Data when Civilizer is running

  1. Click on the man icon at the top-right corner. (See the figure below)
  2. The User Menu will appear.
  3. Click Export Data.
  4. Type your login password and press ENTER.
  5. Download the file by clicking the download button.

User Menu
Figure 1. User Menu

βœ”οΈ Importing Data when Civilizer is online (DEPRECATED & REMOVED)

[NOTE] This functionality has been DEPRECATED and REMOVED ( Since 0.9.0.RC6 )
Use Offline data import as described below.
[NOTE] This functionality is not currently supported on Windows due to some technical limitation.

  1. Click on the man icon at the top-right corner.
  2. Click Import Data.
  3. Type your login password and press ENTER.
  4. Upload the file you'd like to import.
  • The file to import should be what Civilizer would've exported earlier.
  • [CAUTION!!!] Unless you make a backup of it, your current data will completely disappear at the time of clicking OK button on the file upload dialog of your browser.
    • If you have made no backup copy of the current data at all, it would be recommended that you make one by exporting the current data somewhere before importing any data.
  1. Click the button saying "Refresh Page" to reflect the importing.

βœ”οΈ Offline Data Export/Import

You can import/export data while Civilizer is NOT running.

NOTE As a limitation, you need to stop Civilizer to import data!

You will find the following script files at the root of your Civilizer installation package. By executing one of the script files from the command line, you can import/export data.

  • Use -h option to see the help message.
    • e.g) export-data.sh -h
  • Exporting data:
    • Run export-data.sh or export-data.bat (on Windows) without providing any option.
      • This will export your current data to the predefined location.
    • Alternatively, run export-data.sh -to path/to/location or export-data.bat -to c:\path\to\location (on Windows) to specify where to export the data.
  • Importing data:
    • Run import-data.sh or import-data.bat (on Windows) without providing any option.
      • This will import data from the predefined location.
    • Alternatively, run import-data.sh -from path/to/location or import-data.bat -from c:\path\to\location (on Windows) to specify where to import the data from.

βœ”οΈ Exporting Data to .CSV File (Since 0.9.0.RC6)

You can use cvzdata2csv.sh to export data into .CSV files.

For now, this functionality is provided as a Bash script, which means it may be inconvenient for Windows users. (Sorry...)
Windows users can use this script using Cygwin (Babun is recommended) or Windows 10 Bash or Git for Windows.

Synopsis : cvzdata2csv.sh -from [Civilizer DB file] -to [Output dir] table0 table1 ...

-from path    : Specify ABSOLUTE PATH to Civilizer Database File (.h2.db);
              : If not specified, it is assumed to be ~/.civilizer/database/civilizer
-to path      : Specify ABSOLUTE PATH to Output Directory;
              : If not specified, it is assumed to be the Current Working Directory
table ...     : [REQUIRED] Specify Name of Tables to Export; (multiple tables are accepted)
              : Following tables are available (case insensitive)
                FILE
                FRAGMENT
                FRAGMENT2FRAGMENT
                GLOBAL_SETTING
                TAG
                TAG2FRAGMENT
                TAG2TAG

    EXAMPLE   : cvzdata2csv.sh -from ~/.civilizer/database/civilizer -to ~/tmp fragment tag tag2fragemnt

-help, -h, -? : Show this message

For now, this script requires you to explicitly specify name of DB tables to export; Most of the time, DB tables you likely have interest in are the following;

  • FRAGMENT
  • TAG
    • This table represents Tag data
  • FILE
    • This table represents items in File Box
Clone this wiki locally