Connecting existing data folder in fresh installation - postgresql

I had to reinstall Postgres x64 9.0.18 on Windows 7 from scratch and I have a full copy of the old data folder. How can I weave the existing database folder into the fresh installation of Pg 9.0.18? When I install over the same directory structure, the install routine recognizes the old data folder but claims that it doesn't contain proper database data. I also tried to start the postgres service with a different data directory (pointing -D to the copy of /data), but it won't start. Can I somehow edit or patch something in order to access my old database? In former versions there was a pg_databases file.

Related

Why can't delete MYSQL folder in program file (Local Disc C)

I want to uninstall MYSQL workbench in my PC.after uninstall & while deleting MYSQL, it shows the action cant be completed because of the folder or a file in it is open in another program,Close the folder or file and try again .
I always try to delete folder but I couldnt.
You can't delete the folder because mysql service is using it.
Mysql workbench, by default installs mysql as a service, which is the recommended way to run mysql.
On Windows, the recommended way to run MySQL is to install it as a Windows service, so that MySQL starts and stops automatically when Windows starts and stops. A MySQL server installed as a service can also be controlled from the command line using NET commands, or with the graphical Services utility. Generally, to install MySQL as a Windows service you should be logged in using an account that has administrator rights.
From dev.mysql
On Windows, if you have used an installer to install something, you should uninstall it from Add Remove Programs.
Not only will its installer stop the service, and remove all files but also tidy up registry entries.

pgevent.dll can't be deleted because file opened by DHCP Client

I am facing an issue with deleting the PostgreSQL install files after uninstalling PostgreSQL 10 from Windows systems. We have automated scripts (as a part of our product) which uninstall postgres and then delete PostgreSQL installation folders from the system.
In order to uninstall Postgres from the system, we call the uninstall-postgresql.exe file (which is created as a part Postgres install) in the following way:
uninstall-postgresql.exe --mode unattended
The un-installation completes successfully, however when I try to delete the whole Postgresql install folder, I get an error stating:
due to this, the uninstall scripts fail because one of the Postgres files can't be deleted. Currently, we reboot the system and then delete all postgres install files.
Can someone help me delete all postgres install files from the system including this pgevent.dll.
Thanks

Can I install postgresql without pgAdmin4?

I was packaging an windows application installer by NSIS.
An postgresql binary file was included in this install package.
But the official binary file is too large 172MB.
The zip archive is download from
https://www.enterprisedb.com/download-postgresql-binaries
The inside structure is like
pgsql
bin
doc
include
lib
pgAdmin4
share
StackBuilder
symbols
In my opinion, pgAdmin4 is no need for my installer.
There are only CRUD operations in between application and SQL.
If I remove this directory, the binary zip can down to 41MB.
So could I simply remove directory pgAdmin4 and re-compress
to achieve this?
So could I simply remove directory pgAdmin4 and re-compress to achieve this?
Yes, and you can remove StackBuilder too if you want. Also symbols if you don't want to do in-place debugging if the postgres server crashes.
Please, please install your bundled PostgreSQL on a non-default port (not 5432) and if you run it as a service use a name associated with your application, so users know where it came from. See Installation of postgresql with NSIS . Put the PostgreSQL install directory within your app install directory.

Does Postgresql work after copied to other directory on windows?

I'm new to Postgresql and am going to install on A directory for my Application.
After building a package including the Application and Postgresql, I should deliver it to other user(by Installer but Postresql is not embedded).
I was wondering if it is okay for me to just copy Postgresql to other directory without any consideration of registry or environment variables on Windows.
Does it work by copying the all of directories to other directory or server?
If you stop the running PostgreSQL service, and you preserve file permissions when copying/moving, and the destination is also a NTFS filesystem, it will work. But you'll have to adjust the service definition or create a new one to start from the new location; PostgreSQL won't know where the data directory is until you tell it.
However.
You should simply initdb PostgreSQL where it needs to be in the first place. There's no need to copy or move the data directory. Ask the user where they want it to be put and then put it there from the start.
I strongly recommend that you bundle PostgreSQL binaries in your installer rather than having the user run a PostgreSQL installer first. Then have your app initdb its own private PostgreSQL data directory for its use.
See Installation of postgresql with NSIS (it doesn't matter if you're not using NSIS, the principles are the same).

"existing data directory" error when installing PostreSQL for mac

Hey guys i have been trying to download it from the below link
http://www.enterprisedb.com/products-services-training/pgdownload
But once i download it, and try to run the set up it is giving me an error saying
An existing data directory has been selected but its neither empty, or a recognizable date directory,I tried changing the path on which it has to be downloaded it is not letting me do so
I'd recommend trying a package manager such as brew. Once you have it installed simply:
brew install postgres
Disclaimer: I have no experience with Postgres on Mac (or with a Mac at all).
The installer will create a directory where PostgreSQL stores all the database data and information. Without this so called "data directory" PostgreSQL does not work.
This data directory has nothing to do with your download directory.
Apparently you are pointing the installer to a directory that already exists and contains some data (not necessarily Postgres related data).
When being prompted for the "data directory" during installation you have to select an empty directory.
I don't know if the selection dialog of the installer will let you create a new directory, so you might want to create that directory manually before starting the installer.
Recently had this issue after attempting a reinstall of PostgreSQL on macOS 11.6
Removing the contents of the /Library/PostgreSQL/14/data directory seemed to resolve the issue and was able to successfully reinstall