Project

General

Profile

Db conversion » History » Version 1

Marek Hulán, 11/11/2013 12:12 PM

1 1 Marek Hulán
h1. Converting database from sqlite to postgres
2
3
It may not be the best way but it worked for me. I used "taps":https://github.com/ricardochimal/taps gem for conversion.
4
5
First add taps gem to your foreman Gemfile
6
<pre>
7
gem 'taps'
8
</pre>
9
10
and run bundle install.
11
12
Then start taps server which will make your current sqlite accessible
13
<pre>
14
taps server sqlite:///path/to/foreman/db/development.sqlite3 user pass
15
</pre>
16
17
Make sure you have existing postgres DB, username and password ready. With this command you'll start copying data from sqlite to postgres.
18
<pre>
19
taps pull postgres://username:password@localhost/foreman http://user:pass@localhost:5000
20
</pre>
21
22
It will take few minutes (based on amount of data). You'll see the progress during the process.