db backup scripts + bidirectional sorting for stats page