You can copy the data files directly, but you must use the same major version of PG on the destination server (e.g. 8.4.x - the "8.4" is the major). Easiest way to check the version is via psql -V
.
The upgrade procedure in this situation isn't too hard if you want to move up to a 9.x release. You'll need to install 8.4 on the new server (either via a package or by hand), then you'll want to use the pg_upgrade
tool to do the upgrade. pg_upgrade
comes with recent releases of PG, so expect to have two installations on the server during that time.
You can find the docs here.