# Repair an installation

> Diagnose and repair package discovery, cached routes, assets, and migrations while retaining chat history.

[Web documentation](https://threads.teamkrope.com/docs/repair/) · Inner Threads v1.3.0

## Diagnose the installation

Run these commands from the host Laravel app. `inner-threads:doctor` is available in checkouts that include the lifecycle commands. Use the other checks if your installed release predates it.

```bash
composer show teamkrope/inner-threads
composer check-platform-reqs
php artisan migrate:status
php artisan inner-threads:doctor
```

The doctor checks the package’s tables and migration records, bootstrap route, encryption key configuration, and private disk configuration. It returns a failure status when a required check fails. It tests configuration and schema. To verify storage access and old encryption keys in practice, open a saved conversation and download an existing private attachment with an authorized test account.

## Repair package discovery

Use `composer install` to restore the versions in the host lockfile. If only the installed Inner Threads files need to be restored, run `composer reinstall teamkrope/inner-threads`. Clear cached configuration, routes and compiled views, and rebuild package discovery.

```bash
php artisan config:clear
php artisan route:clear
php artisan view:clear
php artisan package:discover
```

Verify package discovery and routes again. A host that disables Composer scripts must run discovery explicitly when deploying. For a manually registered provider, check the provider entry and the app’s auto-discovery exclusions.

## Repair a database or asset issue

Use the migration status to distinguish pending migrations from an inconsistent schema. Apply pending package migrations to the correct database. If a table already exists while its migration is pending, inspect the schema and migration records on a restored copy before repairing them. Keep the existing encryption keys throughout the repair.

The default Blade mount serves versioned assets. If the host uses published assets, back up local overrides, republish the bundle with `php artisan vendor:publish --tag=inner-threads-assets --force`, and invalidate any CDN cache for the old bundle. After the repair, reopen an existing chat, test a private attachment, and rebuild the host’s deployment caches.

See [Install and upgrade errors](https://threads.teamkrope.com/docs/package-troubleshooting/) for specific symptoms and [Upgrading](https://threads.teamkrope.com/docs/upgrading/) to change versions.
