PHPackages                             ryancwalsh/stack-exchange-backup-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ryancwalsh/stack-exchange-backup-laravel

ActivePackage[Utility &amp; Helpers](/categories/utility)

ryancwalsh/stack-exchange-backup-laravel
========================================

My aim is to back up all of my questions and answers and anything else valuable in my accounts across all of the StackExchange sites (StackOverflow, SuperUser, https://apple.stackexchange.com/, https://askubuntu.com/, etc).

2.0.8(5y ago)4262[3 PRs](https://github.com/ryancwalsh/StackExchangeBackupLaravelPHP/pulls)PHPPHP ^7.3CI passing

Since Sep 13Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/ryancwalsh/StackExchangeBackupLaravelPHP)[ Packagist](https://packagist.org/packages/ryancwalsh/stack-exchange-backup-laravel)[ RSS](/packages/ryancwalsh-stack-exchange-backup-laravel/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (7)Dependencies (6)Versions (8)Used By (0)

StackExchangeBackupLaravel
==========================

[](#stackexchangebackuplaravel)

Allows you to export JSON files of your most important data (questions, answers, comments, favorites) from each of your Stack Exchange sites (Stack Overflow, Super User, Server Fault, etc).

Installation
------------

[](#installation)

1. I think this project requires PHP 7.3 or later, so be sure that your system complies.
2. Sign up at  to receive a Client ID, Client Secret, and Key. (It's free, easy, and fast.)
3. Create a Laravel project, and make sure that it works:  (e.g. `composer create-project --prefer-dist laravel/laravel stackExchangeBackupDemo`)
4. Add this package into your Laravel project: `vagrant@vboxHomestead:~/Code/MyLaravelProject$ composer require ryancwalsh/stack-exchange-backup-laravel:^2.0.6` (but use whatever the latest release tag number is at ).
5. Run `php artisan vendor:publish`, and if it gives you a choice, choose to publish from this package.
6. Edit your Laravel project's `.env` file to have your own StackApps values. A non-working sample is below.
7. Run `php artisan exportStackExchange`. There are also these options available:
    1. `php artisan exportStackExchange --forgetCache` is an available option to clear the cached access code value.
    2. `php artisan exportStackExchange --code="YOUR_CODE"` is an available option to provide a code that you've already retrieved from StackExchange.
    3. `php artisan exportStackExchange --S3=false` is an available option to skip uploading to Amazon S3.
8. Following the instructions in the terminal, you'll use your browser to visit a URL that will provide you with a temporary access token to paste into the terminal.
9. Finished! The JSON files will appear in your `/storage/app/StackExchange` folder, and a zip of those files will appear in S3.

```
# These are sample .env values:
STACKAPPS_CLIENT_ID=12227
STACKAPPS_CLIENT_SECRET=ydxGSDFHDF4DtZqCesr)yJIw((
STACKAPPS_KEY=JuWsTgfG2CqjdghkhdgBkQ((
AWS_ACCESS_KEY_ID=AKIAmb3mbn56mn6
AWS_SECRET_ACCESS_KEY=jl234k5jl23k45j23lj5
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=xyz

```

If You Use This Package, Let Me Know!
-------------------------------------

[](#if-you-use-this-package-let-me-know)

**This is the first package that I've ever made, and I'm super curious if anyone will ever use it. If you do try it out, I'd love for you to [open an issue](https://github.com/ryancwalsh/StackExchangeBackupLaravelPHP/issues/new) to say hi** (and of course to tell me any suggestions you have).

---

### If You Want To Get Creative...

[](#if-you-want-to-get-creative)

Visit  to read the docs, and you can modify `ExportStackExchangeHelper.php` to do whatever you want. The Stack Exchange API is great.

### Other Resources That Helped Me

[](#other-resources-that-helped-me)

- I made this README.md file using .
-

Problems for Ryan locally. Workaround / hack.
=============================================

[](#problems-for-ryan-locally-workaround--hack)

The easier way to do what is shown in "Older notes"
---------------------------------------------------

[](#the-easier-way-to-do-what-is-shown-in-older-notes)

2024-07-06\_135807\_ET

1. In WSL (currently Ubuntu 20.04 LTS), and the terminal will ask you for your password. Provide it. Otherwise you'll get nameserver errors later.
2. Run `cd /mnt/c/code/stackExchangeBackupDemo2 && php artisan exportStackExchange --forgetCache`.
3. Visit  and log in.
4. In the left panel, click Saved &gt; stackoverflow.
5. change value of "code" to the value from the URL from the first step.
6. Click send.
7. From the new URL, copy the access token.
8. Paste the access token into the "get" function (see FIXNOW) in `C:\code\stackExchangeBackupDemo2\vendor\ryancwalsh\stack-exchange-backup-laravel\src\ExportStackExchangeHelper.php`.

[\#11 (comment)](https://github.com/ryancwalsh/StackExchangeBackupLaravelPHP/issues/11#issuecomment-824137479)

[https://stackapps.com/questions/10497/suddenly-getting-couldnt-parse-client-id?noredirect=1#comment20685\_10497](https://stackapps.com/questions/10497/suddenly-getting-couldnt-parse-client-id?noredirect=1#comment20685_10497)

Older notes (stale?)
--------------------

[](#older-notes-stale)

[https://stackapps.com/questions/10497/suddenly-getting-couldnt-parse-client-id#comment20685\_10497](https://stackapps.com/questions/10497/suddenly-getting-couldnt-parse-client-id#comment20685_10497)By posting into reqbin.com/post-online in x-www-form-urlencoded mode instead of application/json, I'm able to retrieve an access\_token.

url: [https://stackoverflow.com/oauth/access\_token/json](https://stackoverflow.com/oauth/access_token/json)

payload: client\_id=**(from\_laravel.log)**\_\_ client\_secret=**(from\_laravel.log)**\_\_ code=**(from\_browser\_URL)**\_\_ redirect\_uri=[https://stackexchange.com/oauth/login\_success](https://stackexchange.com/oauth/login_success)

Get the access\_token from the result.

Put a line like `return json_encode(['access_token'=> 'Ke4q2tsof5yfPUTf']);` as the first line of `public function getAccessTokenJson()` in `C:\code\stackExchangeBackupDemo2\vendor\ryancwalsh\stack-exchange-backup-laravel\src\ExportStackExchangeHelper.php`.

In a new VSC window, open C:\\code\\stack-exchange-backup-laravel\\src\\ExportStackExchangeHelper.php in its project.

Note that this is NOT symlinked to C:\\code\\stackExchangeBackupDemo2\\vendor\\ryancwalsh\\stack-exchange-backup-laravel\\src\\ExportStackExchangeHelper.php

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance61

Regular maintenance activity

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 74.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~117 days

Recently: every ~146 days

Total

6

Last Release

1895d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2086493?v=4)[ryancwalsh](/maintainers/ryancwalsh)[@ryancwalsh](https://github.com/ryancwalsh)

---

Top Contributors

[![ryancwalsh](https://avatars.githubusercontent.com/u/2086493?v=4)](https://github.com/ryancwalsh "ryancwalsh (40 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (14 commits)")

### Embed Badge

![Health badge](/badges/ryancwalsh-stack-exchange-backup-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/ryancwalsh-stack-exchange-backup-laravel/health.svg)](https://phpackages.com/packages/ryancwalsh-stack-exchange-backup-laravel)
```

###  Alternatives

[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.6M217](/packages/backpack-crud)[unopim/unopim

UnoPim Laravel PIM

10.5k2.2k](/packages/unopim-unopim)[nickurt/laravel-akismet

Akismet for Laravel 11.x/12.x/13.x

98145.2k3](/packages/nickurt-laravel-akismet)[nasirkhan/module-manager

Module Manager &amp; Generator for Laravel Starter Kit (https://github.com/nasirkhan/laravel-starter)

1043.4k5](/packages/nasirkhan-module-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
