Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
Lutim
Lutim
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 24
    • Issues 24
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 2
    • Merge Requests 2
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Fiat Tux
  • Hat softwares
  • LutimLutim
  • Wiki
  • migrate from sqlite to postgresql

Last edited by Armando Lüscher Oct 11, 2020
Page history

migrate from sqlite to postgresql

Migrate from SQLite to PostgreSQL

Shutdown Lutim to avoid URL creation while migrating.

Install some dependencies:

apt-get install sqlite3 libsqlite3-mod-impexp
sqlite3 /var/www/lutim/lutim.db

In SQLite prompt, do this to export data:

.load libsqlite3_mod_impexp
SELECT export_sql('/tmp/lutim.sql','1');
.exit

Modify the exported file (the export format is close to PostgreSQL's SQL but not quite):

sed -e "s@^INSERT OR REPLACE @INSERT @" -e 's@INSERT INTO "mojo_migrations".*@@' -i /tmp/lutim.sql

Create PostgreSQL database:

su - postgres
createuser lutim_user -P
createdb -O lutim_user lutim_db

Configure Lutim to use PostgreSQL and start it to create the database structure.

Then import the data:

su postgres
psql lutim_db < /tmp/lutim.sql

Go back to wiki's homepage.

Clone repository
  • Clients
    • libraries
  • api
  • broadcast message
  • configuration
  • contribute
  • create theme
  • cron jobs
  • dependencies
  • Home
  • installation
  • memcached
  • migrate from sqlite to postgresql
  • social networks integration
  • softwares integration
  • update