How can I browse my Heroku database? - database

Now that I've deployed my webapp to Heroku, how would I be able to browse the database as it's altered over time?

Try heroku pg:psql. For instructions for how to do this, see this.

If you want to browse your Heroku PostgreSQL database using a browser there is now a free tool for that called Heroku Data Explorer:
https://datazenit.com/heroku-data-explorer.html
It uses Heroku API in real time so your data/credentials stay secure and private. Also it has excellent performance because Heroku local network is used for database connections.

Download PgAdmin 4 and configure your heroku database credentials. Right click on Servers link and choose create >> server. On General tab give Name as per your wish and on Connection tab enter Hostname/address, address, Maintenance database (database name), Username and password which is given in Heroku dabase credentials page. And you will be able to access heroku dadabase on UI free of cost.

I use a tool called Adminer to connect to the DB. The problem is that Heroku will change the credentials for the DB occasionally. You can find them by visiting the Resources tab on your Dashboard then clicking on the DB you use.
It will take you to the Addons page in another tab. Click on the Settings tab then View Credentials.
Using these credentials, you can use Adminer to login to the DB.

Install Beekeeper Studio. Connect to POSTGRES_URL of Heroku with "SSL" enabled.
Easy to view

Related

Update A PostgreSQL Database to Heroku without AWS

I have a local PostgreSQL Database for my Discord Bot on my PC and want to update to my Heroku Application. I have added the Heroku Postgres Addon, but don't know how to upload the Database. I can't use the Amazon Web Services as told in the devcenter since i don't have any Credit Card. Is there any way to upload the Database without AWS? Thank You and sorry for my bad English
You can dump your local database contents to a SQL file with pgdump. Then you can access your Heroku database from your local machine and upload your SQL using the psql command-line client. Get the access url like this from the Heroku command and put it into your client program.
heroku config | grep HEROKU_POSTGRESQL
Know this: sometimes Heroku migrates your data from one host machine to another. When they do that they change your access url. So retrieve that url again whenever you use the psql client.

Power Bi PostgreSQL data import error - The remote certificate is invalid according to the validation procedure.'"

I am trying to connect PostgreSQL database to Power Bi. Database is hosted on Heroku. I am getting the following error -
An error happened while reading data from the provider:
'The remote certificate is invalid according to the validation procedure.
I think i am getting this error because it needs "sslmode=require". but I am not sure how to proceed.
Can someone help me with this problem.
Thanks in advance.
These steps should help you connect to Power BI desktop via ODBC. Note, you should probably create a follower database in heroku so you're not using your production database credentials.
Download PostgreSQL ODBC driver and install. Note, be sure to check the GAC option during installation (https://www.postgresql.org/ftp/odbc/versions/msi/).
Restart computer.
Open Power BI and click "Get Data" button in the ribbon.
Click "Other" and then select "ODBC".
Choose "None" as the data source name.
Click the "Advanced options" and enter this connection string:
Driver={PostgreSQL Unicode};Server=HEROKU_HOST, where HEROKU_HOST is the "Host" from your heroku database credentials (example: ec2-xx-xxx-xx-xx.xxx.amazon.com).
On the next screen, enter the user name (user from heroku db credentials), password (password from heroku db credentials), and for connection string enter the following (with HEROKU_XXXX replaced with your info:
PORT=HEROKU_PORT;DATABASE=HEROKU_DATABASE;POOLING=True;MINPOOLSIZE=1;MAXPOOLSIZE=20;HOST=HEROKU_HOST;COMPATIBLE=2.2.3.0;USER ID=HEROKU_USER;PASSWORD=HEROKU_PASSWORD;SSLMODE=require
I don't use Heroku but had a similar problem with AWS and had to configure the db provider and certificates as described below. I would think that something similar is needed for Heroku.
I did some digging and found 2 possible solutions for Heroku:
Supply the additional settings sslmode=Require;Trust Server Certificate=true in the database connection. This does not seem to be an option with PowerBI, because even under "Advanced Settings" there is nowhere to provide these.
Download the certificate for you database as described here and then follow much the same process as I did below to register the certificate with Windows. If Heroku supplies a P7B (PKCS#7 or pfx (PKCS#12) format certificate you can register that with Windows without having to do the conversion I described.
My setup of the Npgsql provider and AWS Certificates
PowerBI and Excel support connections to Postgres using the Npgsql .NET Data Provider. This provider is not installed by default on Windows. Here's how to install it:
Download the appropriate .msi installer from the Npgsql releases page. The version you need depends on your version of Excel. I am running Office 365, which required version 4.0.x (I installed 4.0.10, download here).
Run the installer. During the install there is an option to install to the GAC which is switched off by default - you must select to have the files installed to the GAC.
Reboot your computer and you should be able to connect setup a Postgres connection in PowerBI or Excel.
AWS RDS Postgres - additional requirement
If you are connecting to a Postgres cluster running in AWS, when you attempt to connect to Postgres after installing the Npgsql provider you may get an error saying:
"The remote certificate is invalid according to the validation procedure"
Here's how to fix it:
Download the public keys for AWS RDS regions: https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem
Convert the bundle to a Windows certificate in P7B/PKCS#7 format. There are many ways to do this, and easy one is to use https://www.sslshopper.com/ssl-converter.html.
In Windows, search for the "Manage User Certificates" utility and open it.
Right-click on "Trusted Root Certificate Authorities", "All Tasks", "Import..."
Select the .p7b file which was the output of converting the AWS keys to P7B format.
Choose to place all certificates in the Trusted Root Certification Authorities store.
You will probably have to confirm for each certificate - there is one per AWS region
You should now be able to connect to your AWS RDS Postgres database from PowerBI or Excel.
You need to check if the host based authentication in your postgres database is allowing this from connection from POWERBI.
[https://www.postgresql.org/docs/current/auth-pg-hba-conf.html][1]
The file is usually available in the postgres data folder and the structure is like below. Make sure the client host, username have the right permissions to access the database.
local database user auth-method [auth-options]
Note: If you are using a cluster manager like patroni, the pg_hba.conf file will be overwritten by Patroni every time you edit it. you will have to edit this configuration from the patronictl command.

ssrs password accessing report builder

After successfully installing SQL Server Express 2012. I am trying to get set up my Report Builder. Unfortunately I am asked for a password when clicking on the Report manager URL or the Web Services URL. It says something like this (connecting to "my_Pc").
As far as I am aware I do not have any password on my PC nor set up one when configuring my SQL Server. Please note that I have not configure SSRS yet and my Service account is still ReportServer$SQLExpress. How do I sort this out please
?
Issue is with how you have created data source for Report.
Data source is created with option "Prompted Credentials" .
It should be created with "Stored Credentials" or "Windows Integrated Security"
Read more
At one point you might have configured the user "sa", have you tried using sa login to access the report page? If you are using machine id to authenticate with sql server, to configure a new user, after you connect to your database, browse down to security > logins > right-click and choose "new login".
One easy solution for this is to check the browser you are using . |I was using internet explorer edge and realise that explorer edge was simply not trusting that site. So if you are on explorer just go on setting and trust the site.
However I was on IE edge which does not trust any site. I changed it for google chrome. Everything is running perfectly fine. just change the browser (Internet Explorer best as Google could pose problem to visualize data when creating reports) and refresh everything should be running just fine.

Migrating dotnetnuke from development to test server

I am a newbie with DotNetNuke and have been stumbling on how to deploy from the development server to the deployment server. For starters my development and deployment servers are one and the same machine. Here are the steps that I did:
DNN Setup
Downloaded DNN using WebMatrix.
Launched DNN and proceeded with the installation wizard, which is basically just testing the environment and then creating the DNN database.
After the wizard's installation launching DNN will now proceed to the Getting Started page
Added "localhost/dnn" in the site alias list
Moving to ISS
In IIS I added application (folder) DNN in the web root
I copied all the files from the original webmatrix path to the dnn folder in c:\inetpub\webroot making sure that the file/folder hierarchies are the same
Result:
When launching DNN using my browser I am directed to the installation wizard page instead of the Getting Started page. What am I missing?
Thanks!
Confirm that the permissions on the folder containing DNN are the same on your test server as they are on your development server. (I give Network Service read/write and IUsr Read/Execute)
Confirm that the application pool running your application has the proper identity (Network Service is suggested) and is running the proper .NET Framework version; based upon your question, I think you are set on this.
Gain access to your web.config file. You will see a ConnectionStrings section. You probably need to update the connection strings.
If your test server runs off of a different database than your dev server, figure out the connection string of your test server and update your connection string accordingly
You may be able to restore a .BAK file of your DB to your test server
If you do this, you will probably need to (in SSMS) edit your Portal Alias table to include the host name that you are using in your test server environment. Examples: Maybe you access the site via localhost/ on your dev environment, but you access to test site via test.Ronald.com? test.Ronald.com would be your PortalAlias
If your test server runs off the same database server as your dev server, it sounds like you need to open up access in firewalls so that your test server has connectivity to your dev database
A word of advice
Once you get it running, you will be making changes to each database separately (assuming your test site and dev site use different DB Servers). This sync issue can be a royal pain with DNN, as your page structures, module assignments, html module contents, installed modules/extensions will get out of sync. While restoring backups is nice, it is not a very good long-term solution. I recommend database-syncing tools
The problem is most likely a problem with DNN not being able to find the Database. If it can't find the database, it will run the wizard in order to create one.

Why is Windows authentication using wrong username?

We have an ASP site using Windows authentication to connect to a SQLServer database. There are three instances of the web site, a Dev environment (located on my Workstation), an UAT environment and a production environment, which are on separate servers.
When I access the Dev site (which uses the same DB as the UAT site) I have no issues, the site connects to the database using my Windows account. However when I connect to the UAT site, it uses a different account (one which belongs to me but is not connected to my default Windows login) which is not permissioned on the DB, so the site returns the following error:
Microsoft OLE DB Provider for SQL
Server error '80004005'
Cannot open database requested in login 'ANAML'. Login fails.
/inc/dbconnect.asp, line 4
The ASP files on the Dev and UAT sites are identical, so can anyone explain why the UAT site might be using the incorrect Windows account? This only affects me, from all workstations, and no other users.
Have rebooted the server and my workstation, and cleared my internet files locally.
I found the answer at this page on ServerFault. Seems the login details for the UAT server had been stored in the Users control panel at some point. Deleting the relevant entry in the control panel restored the correct login when connecting to the website.
Well, my ASP knowledge has mostly faded but I'll see what comes out of my brain. My first thought would be that the Virtual Directory security is configured differently on the server where it is failing. It sounds like you would need it to be set to "Integrated Windows Authentication" only.
If that is set correctly then I'd ask about your connection string. Does your connection string specify Trusted Connection (e.g. it does not specify a username and password)?
Where does the ANAML account come from? Is it a SQL only login or is it a windows account?

Resources