If you have many dataclips pointing to a database, and upgrade that database to a different plan, those dataclips will continue pointing to the old database. This will show you how to update all of those dataclips to point to the new database.
- Go to https://dataclips.heroku.com
- Log in if prompted to
- Open up https://dataclips.heroku.com/api/v1/heroku_resources
- Search by heroku app name using Cmd+F. Resource ID should look something like
resource123@heroku.com
- Record this ID for the databases you're transferring from and to.
Replace resource123@heroku.com
with the resource ID of the database you are moving away from.
var clips;
$.getJSON("https://dataclips.heroku.com/api/v1/clips", function(response) {
clips = response.filter(function(clip) {
return clip.heroku_resource_id === "resource123@heroku.com";
});
console.log("Found this many dataclips: " + clips.length);
});
Replace resource456@heroku.com
with the resource ID of the new database.
var postData = JSON.stringify({
heroku_resource_id: "resource456@heroku.com"
});
clips.forEach(function(clip) {
var url = "https://dataclips.heroku.com/api/v1/clips/" + clip.slug + "/move";
$.ajax({
type: "POST",
url: url,
data: postData,
success: function() {
console.log("Migrated:" + clip.slug);
}
});
});