Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
biboumi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
90
Issues
90
List
Boards
Labels
Service Desk
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
louiz’
biboumi
Commits
e4122880
Commit
e4122880
authored
Dec 27, 2017
by
louiz’
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a documentation to explain how to migrate from sqlite3 to postgresl
fix #3319
parent
bb2dd2b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
0 deletions
+50
-0
CHANGELOG.rst
CHANGELOG.rst
+29
-0
scripts/dump_sqlite3.sh
scripts/dump_sqlite3.sh
+21
-0
No files found.
CHANGELOG.rst
View file @
e4122880
...
@@ -11,6 +11,35 @@ Version 7.0
...
@@ -11,6 +11,35 @@ Version 7.0
- Fix the iq result sent at the end of a MAM response. Some clients (e.g.
- Fix the iq result sent at the end of a MAM response. Some clients (e.g.
gajim) would throw an error as a result.
gajim) would throw an error as a result.
Sqlite3 to PostgreSQL migration
-------------------------------
If you used biboumi with the sqlite3 database backend and you want to
start using postgresql instead, follow these simple steps:
- Make sure your Sqlite3 database has the correct format by running at
least biboumi version 6.0 against this database. Indeed: biboumi can
upgrade your database scheme by itself automatically when it starts, but
the migration process can only migrate from the latest known schema,
which is the one in version 6.x and 7.x. If you are migrating from
version 6.x or 7.x, you have nothing to do.
- Start biboumi (at least version 7.0) with db_name configured to use
your postgresql database: this will create an empty database, create all
the tables with all the rights columns, ready to be filled.
- Backup your database if you value it. The migration process will not
write anything into it, so it your data should theorically be kept
intact, but we never know.
- Run the dump script found in biboumi’s sources:
`<scripts/dump_sqlite3.sh>`_. Its first and only argument must be the path
to your sqlite3 database. For example run `./scripts/dump_sqlite3.sh
/var/lib/biboumi/biboumi.sqlite`. This will create, in your current
directory, some sqlite files that contain instructions to be fed into
postgresql.
- Import all the ouput files thusly created into your PostgreSQL, with
something like this: `psql postgresql://user@password/biboumi < *.sql`.
This takes a few minutes if your database is huge (if it contains many
archived messages).
Version 6.1 - 2017-10-04
Version 6.1 - 2017-10-04
========================
========================
...
...
scripts/dump_sqlite3.sh
0 → 100755
View file @
e4122880
#!/bin/sh
sqlite3_args
=
$@
function
dump_table
{
table
=
$1
columns
=
$2
echo
".mode insert
$table
.output
$table
.sql
select
$columns
from
$table
;"
| sqlite3
$sqlite3_args
}
dump_table
"roster"
"local, remote"
dump_table
"ircserveroptions_"
"id_, owner_, server_, pass_, afterconnectioncommand_, tlsports_, ports_, username_, realname_, verifycert_, trustedfingerprint_, encodingout_, encodingin_, maxhistorylength_"
dump_table
"ircchanneloptions_"
"id_, owner_, server_, channel_, encodingout_, encodingin_, maxhistorylength_, persistent_, recordhistory_"
dump_table
"globaloptions_"
"id_, owner_, maxhistorylength_, recordhistory_, persistent_"
dump_table
"muclogline_"
"id_, uuid_, owner_, ircchanname_, ircservername_, date_, body_, nick_"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment