Let us sum up the process so far. We have adjusted the postgresql.conf file (wal_level, max_wal_senders, archive_mode, and archive_command) and we have allowed for the pg_basebackup command in the pg_hba.conf file. Then, the database was restarted and a base backup was successfully produced.
Keep in mind that base backups can happen only while the database is fully operational—only a brief restart to change the max_wal_sender and wal_level variables is needed. The backup can happen only while the database is fully active.
Now the system is working properly, we might face a crash from which we want to recover. Therefore, we can perform PITR to restore as much data as possible. The first thing we've got to do is ...