Is there a way to append '_TEST' to all pages (excluding Main_Page) in the the database?
Looking at the page.page_title
in the database the field is hashed so not sure the best method to change it (other than going through each one manually).
Don't touch the database manually, it's just asking for breaking stuff. There is maintenance script maintenance/moveBatch.php
that renames a batch of pages from shell while maintaining referential and logical integrity.