1st - How does Heroku interact with a database (sqlite) 2nd - How can I obtain the version of database that is on Heroku? - database

I had a very hard time trying to find solutions to this problem online, probably because I do not know how to phrase this weird problem. I also could not reach out to Heroku as their support team only serves paid customers. I would really appreciate help from anyone.
Some context:
I have recently started experimenting with Heroku and deployed my first web app (Python, Flask, SQLite3) via GitHub. It works as intended, I am even able to interact with my database (add/delete/update). However, after making an update to my code locally and pushing it to GitHub, I realised that when my web app got built again by Heroku with the updates, the changes I made to the SQLite database is reverted back the initial, local version. (aka I lost the updates I made during testing).
So here comes the first question:
How does Heroku actually interact with the database? Does it create a copy of all my code from GitHub and runs it locally on their servers? (Since no changes to the database are reflected in my GitHub Repo despite successful updates to the database values through the web app).
And if so, this is the second question:
Is there any way for me to get this "updated version" of my database from Heroku side so I can download it locally before I make and push any updates to my code, so as not to erase all the updates to the database that a user might have made through the web app?

Related

GCloud App Engine old instances still running

We've build few services on Google App Engine, we've ship them into production and everything worked as expected. But now I have little issue with one of my integration service which runs on flexible environment. I've deployed serveral times new version and maybe some of deploys wasn't successfully finshed or something like that. Now I see in Stack Driver logging some error logs from running instances of some old version (by version id in "resource" property). It made me few problems with with some version "missmatch" in integration tasks. I don't see this old versions in GC CLI SDK or in web dashboard. I've tried to delete whole service and redeploy it, but after first deploy, there are still new log entries in Stack Driver. I've changed DB credentials to prevent older versions to make mess in DB ¯_(ツ)_/¯. Production environment now runs OK, but there are still some old services spamming logging with errors about DB auth. I cant find this old versioned instances anywhere except this new log entries. Is it normal behaviour? Do you have some tips?

Deploying umbraco site to production database

We have an umbraco site connected to MSSQL databases, which have three phases:
1) Local:
This site is connected to a database running on our syst-server and is for our developers to mess around with as intended. This database is pretty much for testing and messing around
2) Syst:
This site is pretty much a deployed version of the local site, still connected to our syst-database. This is for our testing team to ensure everything looks good (apart from stuff like product data, since we will be creating a lot of test products in syst).
3) Production:
This is where the magic happens. We have a seperate database for production, which has valid data for our company.
Now my question is:
How would I sync umbraco changes made to our production database, whilst not syncing products? Is there a smart tool made for syncing only umbraco data, and keeping out custom data?
Umbraco Courier - https://umbraco.com/products/umbraco-courier/.
You can pick exactly what you want to push to the production site.

How to include database in website deployment?

I try to setup a deployment workflow, but I am completely new to it. I consider to use Git and Bamboo and in this whole thing I am stuck with the database.
Let's say I want to make changes on a CMS website and keep my files versioned on git (bitbucket), I understand how to setup Bamboo that it can SCP the files to my webserver, but I don't get it how I can get the database into this whole system? Are there any tools I am missing?
What I want:
I want to be able to checkout my website files from the gitserver, make changes and send them back to the gitserver and this (via Bamboo) should push the files to the live or testserver.
But even after searching for hours, I don't get a smooth way how to handle the database (getting it local, making changes and pushing it to the server via git) or any other smooth way.
I know there are tools to quickly dump the db for WordPress sites, but for other CMS there are no such tools.
Any advice how to do this right?

GAE push to deploy when multiple devs

By deploy, I assume they mean code changes are pushed to production?
If I had 2 or three devs working with me on a project, what is to stop them from pushing changes that break the production site?
What checks and balances do we have to avoid such error? Do you setup a staging and production environment in GAE, having someone manually verify everything appears to work before making live.
If you want to limit individual devs doing uncontrolled pushes to the code.google.com (from which the deploys happen), then arrange for one and only one local repository be the local repo-of-record, and only configure that one to know about the source.google.com 'origin' server. Integrations are pulled into that repo, and (when you're ready) push to deploy from there.
Here's how it works under the covers. When you use gcloud to set up a project, it modifies default/.git/config to know about source.google.com, and to use an authentication helper that ties in to oauth (re-using the token that gcloud auth login will store locally) to authenticate. To limit deployment, make this the integration repo, and configure dev repos to push to it.
If you set up a separate staging version of the app, it's a policy decision on your side about whether to use the same scheme, or let developers deploy to staging individually. The mechanism you'd use to configure this is all .git/config wiring.

how can I change my app-id in GAE and still access the same permanent datastore?

I am developing an app locally in Google App Engine. I have built a small datastore for development purposes. Rebuilding it after every power cycle on my Mac got tedious so I made it permanent. Now I run my app locally with the following command:
/usr/local/bin/dev_appserver.py "--datastore_path=./permanent.datastore" appengine_prototype
Life is good. I have decided to deploy my app so I can test http post commands from a different machine. When I tried to register my current application id (example), I found that it was unavailable (shocker!). So I registered a different application id and planned to change my local application id to match. However, when I changed the
application: *app-id*
line in my app.yaml file, my app stopped recognizing my permanent datastore.
So, how can I change my application id to the one I registered, maintain the connection to the permanent datastore and then push the whole shebang online? I tried running the app twice locally, first with the permanent datastore referenced in the command and then without, hoping that the default temporary datastore would inherit from the previous permanent datastore. That didn't work. Do I need to start by copying the permanent datastore to the default temporary datastore? How would I do that? Any help would be much appreciated.
Thanks,
Dessie
If your intention is to eventually push your local data to your live environment anyway, then your best bet is to:
use bulkloader.py to backup your local data (while using oldid in your config)
then change your config to your newid
then use bulkloader.py to push your data to your new development server (ran with --datastore_path=./permanent.datastore2 or something)
then use bulkloader.py to push your data to the GAE production server
Details of bulkloader.py can be found in the docs and an example here

Resources