diff --git a/server/migrations/moveBucket.js b/server/migrations/moveBucket.js index 21286713..e8e25d17 100644 --- a/server/migrations/moveBucket.js +++ b/server/migrations/moveBucket.js @@ -39,8 +39,8 @@ Project.count({}) async.eachSeries(projects, (project, cb) => { console.log(project.name); async.eachSeries(project.files, (file, fileCb) => { - if (file.url && file.url.includes('p5.js-webeditor')) { - file.url = file.url.replace('p5.js-webeditor', process.env.S3_BUCKET); + if (file.url && file.url.includes('s3-us-west-2.amazonaws.com/')) { + file.url = file.url.replace('s3-us-west-2.amazonaws.com/', ''); project.save((err, newProject) => { console.log(`updated file ${file.url}`); fileCb(); diff --git a/server/migrations/start.js b/server/migrations/start.js index 313f9f5e..3f01413f 100644 --- a/server/migrations/start.js +++ b/server/migrations/start.js @@ -1,3 +1,3 @@ require('babel-register'); require('babel-polyfill'); -require('./s3UnderUser'); +require('./moveBucket');