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. Heroku ID should look something like
5c6f807a-e3bb-4f3e-8d46-f4da3ec9b35d
- Record this ID for the databases you're transferring from and to.
Replace 5c6f807a-e3bb-4f3e-8d46-f4da3ec9b35d
with the heroku 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_id === "5c6f807a-e3bb-4f3e-8d46-f4da3ec9b35d";
});
console.log("Found this many dataclips: " + clips.length);
});
Replace 8df837a-b321-4f3e-8f56-fadab445b35d
with the heroku ID of the new database.
var postData = JSON.stringify({
heroku_id: "8df837a-b321-4f3e-8f56-fadab445b35"
});
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);
}
});
});