-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from it3s/migration
Migration
- Loading branch information
Showing
10 changed files
with
390 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,7 @@ | |
|
||
# uploads | ||
/public/uploads | ||
/public/mootiro_media | ||
|
||
# vagrant | ||
.vagrant | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class MootiroOID < ActiveRecord::Base | ||
belongs_to :content, polymorphic: true | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class CreateMootiroOids < ActiveRecord::Migration | ||
def change | ||
create_table :mootiro_oids do |t| | ||
t.string :oid, index: true | ||
t.references :content, polymorphic: true, index: true | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddMigratedInfoToMaps < ActiveRecord::Migration | ||
def change | ||
add_column :maps, :migrated_info, :json | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
## migrating from mootiro | ||
|
||
- run Intermediate redis (set a really long pass) | ||
- set on the server the following env vars: | ||
|
||
``` | ||
export REDIS_HOST=host | ||
export REDIS_PORT=6379 | ||
export REDIS_PASS=really long redis server password | ||
``` | ||
|
||
- run django shell | ||
|
||
``` | ||
from migrate.tasks import migrate_all | ||
migrate_all() | ||
``` | ||
|
||
- on the Meppit server set these env vars | ||
|
||
``` | ||
export MOOTIRO_REDIS_HOST=host | ||
export MOOTIRO_REDIS_PORT=6379 | ||
export MOOTIRO_REDIS_PASS=really long redis server password | ||
``` | ||
|
||
- copy all media files from Mootiro `media/upload` folder to Meppit `public/mootiro_media` | ||
|
||
- run the task | ||
|
||
``` | ||
rake mootiro_import | ||
``` | ||
|
||
WARN: sometimes the connection with redis dies, If that happens just run again the task, and it will resume | ||
from where it stoped |
Oops, something went wrong.