Skip to content

Commit 8356dbb

Browse files
authored
Merge pull request #145 from cloud-gov/migrate-platform-data
migrate datastore
2 parents 13179db + 23c5bc6 commit 8356dbb

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

jobs/elasticsearch-platform/spec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,7 @@ properties:
149149
default: ''
150150
elasticsearch.snapshots.repository:
151151
description: Repository name for automatic snapshots
152-
default: ''
152+
default: ''
153+
elasticsearch.migrate_data:
154+
description: migrate data from /var/vcap/store/elasticsearch to /var/vcap/store/elasticsearch-platform
155+
default: false

jobs/elasticsearch-platform/templates/bin/pre-start

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,16 @@ chown root:vcap /var/vcap/jobs/elasticsearch-platform/config/jvm.options
2626
log_dir=/var/vcap/packages/elasticsearch-platform/logs
2727

2828
if [[ -d ${log_dir} ]]; then
29-
rmdir ${log_dir}
29+
# rmdir fails on a symlink
30+
rmdir ${log_dir} || rm ${log_dir}
3031
fi
3132

3233
if [[ ! -a ${log_dir} ]]; then
3334
ln -s /var/vcap/sys/log/elasticsearch-platform ${log_dir}
34-
fi
35+
fi
36+
37+
<% if p("elasticsearch.migrate_data") %>
38+
if [[ -d /var/vcap/store/elasticsearch ]]; then
39+
cp -pR /var/vcap/store/elasticsearch/nodes /var/vcap/store/elasticsearch-platform
40+
fi
41+
<% end %>

jobs/elasticsearch-platform/templates/config/config.yml.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ bootstrap:
33

44
path:
55
logs: "/var/vcap/sys/log/elasticsearch-platform"
6-
data: "/var/vcap/store/elasticsearch"
6+
data: "/var/vcap/store/elasticsearch-platform"
77
<% if p('elasticsearch.path_repo') != '' %>
88
repo: ["<%= p('elasticsearch.path_repo') %>"]
99
<% end %>

0 commit comments

Comments
 (0)