PDA

View Full Version : Moving data base to an external hard drive



gring000h
11-24-2009, 05:44 PM
I don’t have enough room on my hard disk for my database, so I want to move it to my external hard disk. From what I understand, this is how I should proceed: http://www.holdemmanager.net/faq/afmviewfaq.aspx?faqid=154

Can I simply delete the contents of the c:\program files\PostgreSQL\8.2\data folder after I copied it to my external hard drive?

What about the archived hand histories I have now stored on my D drive? Can I move those to my external hard drive as well?

I figured it might be best to make a back up of my database first before I proceed with any of these actions. But since I do not have enough free space for a back up on my hard drive, I figured I could save the back up to my external hard drive? Would that work?

Another thing I have on my mind is whether I should want to do a clean and restore. I read in the forum that the way to free up most space is to export all hands from the database http://www.holdemmanager.net/faq/afm....aspx?faqid=12, then uninstall PostgreSQL via control Panel > Programs And Features then delete the PostgreSQL folder in C:\Program Files and then install PostgreSQL again http://www.holdemmanager.net/faq/afm...aspx?faqid=176 and finally import those hands

A final thing on my mind is whether I should want to upgrade my postgresql 8.2 version to a newer version when I reinstall it?

Thanks in advance!

fozzy71
11-24-2009, 05:56 PM
I don’t have enough room on my hard disk for my database, so I want to move it to my external hard disk. From what I understand, this is how I should proceed: http://www.holdemmanager.net/faq/afmviewfaq.aspx?faqid=154

Yes, or you could reinstall the same version of postgresql and point the installer to the moved \data folder, or you could export, clean reinstall/upgrade, and import again.


Can I simply delete the contents of the c:\program files\PostgreSQL\8.2\data folder after I copied it to my external hard drive?

Yes, if you are sure it is safely copied somewhere else.


What about the archived hand histories I have now stored on my D drive? Can I move those to my external hard drive as well?

Yes.


I figured it might be best to make a back up of my database first before I proceed with any of these actions. But since I do not have enough free space for a back up on my hard drive, I figured I could save the back up to my external hard drive? Would that work?

You should definitely backup everything, but the exported hands from the HM DB are saved to the same partition as the installation. Can you clear up some free space in other areas, so that you can export your DB to text files? Here are my backup instructions - http://www.holdemmanager.net/forum/showthread.php?t=20754



Another thing I have on my mind is whether I should want to do a clean and restore. I read in the forum that the way to free up most space is to export all hands from the database http://www.holdemmanager.net/faq/afm....aspx?faqid=12, then uninstall PostgreSQL via control Panel > Programs And Features then delete the PostgreSQL folder in C:\Program Files and then install PostgreSQL again http://www.holdemmanager.net/faq/afm...aspx?faqid=176 and finally import those hands

A final thing on my mind is whether I should want to upgrade my postgresql 8.2 version to a newer version when I reinstall it?

I probably would use this as a good point to upgrade. Make sure you follow my backup cliff notes. Then use these instructions to reinstall postgresql - http://forums.holdemmanager.com/showthread.php?t=20755

BUT, do not use the installer linked there. Use this installer instead, which will give you the option to change the \data directory to a different partition.

http://www.enterprisedb.com/products/pgdownload.do#windows

gring000h
11-24-2009, 06:17 PM
Thanks for the quick reply!

The PostgreSQL folder on my C drive is 22GB in size and I have 6GB of free space left on that drive (out of 50GB in total). I'm sure I could clear up a few GB, but clearing out 16GB will be problematic. I assume the back up will have the same file size as the PostgreSQL folder?

fozzy71
11-24-2009, 10:31 PM
No. The text files are smaller than the postgresql \data folder, especially if your \data\pg_log folder is full of log files. My DB is about 1.6GB (no log files) and exports to approximately 435MB.


Logging:

I would suggest you turn off logging on your new SQL installation as well as these other performance improvements - Top 10: HEM performance increase tips


To turn off logging, follow these instructions. This is the first thing I do anytime I install SQL for someone.

- Start > My Computer > Tools > Folder Options > View > UnCheck 'Hide Extensions for known file types' > OK

- C:\Program Files\PostgreSQL\data\postgresql.conf > Right-Click > Open With.. > NotePad > Check 'Always use this program'

- Scroll about half way down to ~Lines 245 - 260:

- The last line of this block of code, for the 'logging_collector', must be changed from On to Off.



------------------------------------------------------------------------------
# ERROR REPORTING AND LOGGING
#------------------------------------------------------------------------------

# - Where to Log -

log_destination = 'stderr' # Valid values are combinations of
# stderr, csvlog, syslog and eventlog,
# depending on platform. csvlog
# requires logging_collector to be on.

# This is used when logging to stderr:
logging_collector = off # Enable capturing of stderr and csvlog


File > Save; File > Close

Start > Programs > PostgreSQL 8.3 > Reload Configuration.


- Start > My Computer > C:\Program Files\PostgreSQL\data\pg_log, or C:\Program Files (x86)\PostgreSQL\data\pg_log, if you have 64 bit Vista. Delete all files in that folder. And it might be a good idea to empty your recycle bin at that point, or use a 3rd party utility like CCleaner to clean up all your junk/temporary files. You want to do this before you get to the vacuum and defrag process.

gring000h
11-25-2009, 04:53 AM
I noticed that the folder with my archived hand histories is pretty large in size as well: 38GB. Is there any cleaning up I could be doing with this folder?

gring000h
11-25-2009, 08:00 AM
I had forgotten about this, but apparently I still have multiple databases. I made a screen shot for you to see.

I use the "HoldemManager2" database. Iirc I ran into some start up problems with my "HoldemManager" database and I assume the other ones are my old PT2 databases...?

This is probably why the back up for my main database "HoldemManager2" turned out to be only 790MB in size, whereas my PostgreSQL folder is ~22GB in size...?

If my assumptions are correct, can I then simply delete these databases when I have no use for them anymore? That should clear up a lot of space, right?

LINK TO SCREENSHOT (http://dl.dropbox.com/u/2175143/HEM%20screenshot.JPG)

netsrak
11-25-2009, 08:12 AM
You can delete the not used Holdemmanager* and PTG* Databases but don't touch the postgres database.

gring000h
11-27-2009, 06:54 AM
I don't know how to perform step 3 and run the command as administrator...?: http://forums.holdemmanager.com/showthread.php?t=20755

I use Windows XP and I don't know of any administrator function or password. Is this step necessary? I want to start playing again asap.

netsrak
11-27-2009, 08:29 AM
Just type Start -> Run -> cmd and enter the command in the command box.

gring000h
11-27-2009, 09:14 AM
Thanks. I'm sorry to keep on bothering you, but I'm just such a n00b when it comes to computer stuff...

I want to restore my old database as described here: http://www.holdemmanager.net/faq/afmviewfaq.aspx?faqid=12

However, I run into problems with this: 5) In the Properties tab, enter a new name and leave everything else except the Encoding as default. For the Encoding you need to use the same value as in the original database (SQL_ASCII for older databases, UTF8 for Postgresql 8.4 databases). Click OK.

It won't accept the SQL_ASCII encoding: SCREEN SHOT (http://dl.dropbox.com/u/2175143/postgreSQL%20encoding.JPG)

How should I proceed?

netsrak
11-27-2009, 12:07 PM
The error message tells you exactly what to do....
choose template0 in the template field

fozzy71
11-27-2009, 12:32 PM
Use template0 as suggested and it should work.